How do I cap my framerate at 60 fps in Java?

William picture William · Apr 21, 2009 · Viewed 55.3k times · Source

I am writting a simple game, and I want to cap my framerate at 60 fps without making the loop eat my cpu. How would I do this?

Answer

cherouvim picture cherouvim · Apr 21, 2009

You can read the Game Loop Article. It's very important that you first understand the different methodologies for the game loop before trying to implement anything.