Login  Register

looking for an advice for my application LOOP

Posted by bardackx on Apr 16, 2011; 8:18pm
URL: https://forum.jogamp.org/looking-for-an-advice-for-my-application-LOOP-tp2828837.html

I just noticed that Thread.sleep is not totally accurate when the JVM is bussy (the thread oversleeps or undersleeps) can you help me?

EDIT: I was in a hurry when I wrote the post, let me rewrite it.

In my application main loop I perform the game logic and then sleep the thread for 25-(game logic cost) milliseconds, and sometimes the sleep last for more than 25 milliseconds, throwing unpleasant results, I want to know how yo deal with this issue in Java, I hope you can help me, thanks in advice.