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?
In java you could do System.currentTimeMillis() to get the time in milliseconds instead of glfwGetTime().
System.currentTimeMillis()
glfwGetTime()
Thread.sleep(time in milliseconds) makes the thread wait in case you don't know, and it must be within a try block.
Thread.sleep(time in milliseconds)
try