final int FPS = 60;
// 1 secondes divisée en 60 frames;
final long timeForAFrame = 1 000 000 000 / 60;
long beginTime = CurrentTime();
doSomeStuff();
long elapsedTime = CurrentTime();
long remainingTime = timeForAFrame - elapsedTime;
sleep(remaining);
Created
January 28, 2014 21:01
-
-
Save bendem/8676430 to your computer and use it in GitHub Desktop.
How a game loop is filled...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment