I was wondering if the try-catch block significantly influences the game speed. Let’s say I have a map class that draws something each frame. If something goes wrong, it throws a MapException. Because of this, in my game’s rendering method I have something like this:
try
{
Map.render();
}
catch (MapException mex)
{
System.err.println("Error with drawing the map");
System.exit(1);
}
Now this part of code is called probably about 50 times per second, so I was wondering if it’s severly influencing the game speed. Throwing and catching errors is not that important anyway cause once the game is built up a map won’t be able to throw any exceptions cause there will be none, but if it doesn’t influence the game speed I might leave it there just in case the user’s computer explodes ;D