Netbeans runs better than compiled file
Hi everyone, i have an issue with a "game" i'm making...
The game have a graphical interface builded with canvas, it has 2 threads, and both have something like:
My problem is that when i run it in netbeans the average milliseconds the game uses to "render" is 25. But when i build and run the jar file the average time to render is even more than 80...
Thread.sleep(Math.max(timeSlice + startTime - endTime, 0));
So the game runs perfectly with netbeans but the jar runs verry badly.
Re: Netbeans runs better than compiled file
Ouch - that looks to be an extremely ugly and inaccurate approach. Since you are using Canvas I suspect you are not using Swing and should be using a java.util.Timer and calling the doStuff() in the actionPerformed() method.