How to make timer for a game loop?
问题 I want to time fps count, and set it's limit to 60 and however i've been looking throught some code via google, I completly don't get it. 回答1: You shouldn't try to limit the fps. The only reason to do so is if you are not using delta time and you expect each frame to be the same length. Even the simplest game cannot guarantee that. You can however take your delta time and slice it into fixed sizes and then hold onto the remainder. Here's some code I wrote recently. It's not thoroughly tested.