Limiting frame rate with Thread.sleep()
<p>I am working on a live wallpaper, so no worries about physics collisions. I just want to have as smooth a frame rate as possible, up to a limit of 30fps to conserve battery. </p>

<p>To do this, at the end of the loop, and I measure time since the beginning of that loop. If the frame took less than 33ms, I use Thread.sleep() to sleep the number of ms to get up to 33. </p>

<p>However, I know that Thread.sleep() is not super accurate, and is likely to sleep longer than I ask for. I don't know by how much. </p>

<p>Is there a different method I can use that will provide a more even rate? </p>
