Measuring FPS

So, I’ve been going back and forth between incrementing the FPS control variable by one second and just setting it to the current time when the FPS gets updated. I don’t know which to do, or why. Incrementing it by one second reports a silky smooth 60, setting it to the current time reports between 60 and 63. I asked on #lwjgl (that’s why the code is a pastie) but nobody answered. Help?

Relevant code: http://www.java-gaming.org/?action=pastebin&id=56

Setting lastFPS to the current time results in a time leak. You should always be incrementing by 1 second.

Oh and you should be incrementing the fpsCount variable before the if statement because you need to count that frame as part of the second :wink: