I work on live wallpapers, so donโt worry about collisions with physics. I just want to have as smooth a frame rate as possible, up to the limit of 30 frames per second, to save battery.
To do this, at the end of the cycle, and I measure the time from the beginning of this cycle. If the frame took less than 33 ms, I use Thread.sleep () for the sleeping number of ms to get up to 33.
However, I know that Thread.sleep () is not super accurate and will most likely sleep longer than I ask. I donโt know how much.
Is it possible to use another method that will provide a more even speed?
source share