looking for an advice for my application LOOP

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

looking for an advice for my application LOOP

bardackx
This post was updated on .
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.
Reply | Threaded
Open this post in threaded view
|

Re: looking for an advice for my application LOOP

Demoscene Passivist
Administrator
To get accurate timing try to use vsync as sychronization source in ur GLEventListener.