So I'm using a call like:
Sleep(16 - millisecondsElapsed);
at the end of every frame draw in my program loop to limit it to 60fps. But if you do the math, 1000ms / 16ms/frames = 62.5frames
, and the way I count frames in my program reflects this. You would need to sleep for ~16.67ms to be accurate. As far as I know, there is no way to sleep for less than a millisecond on Windows.
So what would be the most accurate way to limit FPS?
question from:
https://stackoverflow.com/questions/65863974/whats-the-most-accurate-way-to-limit-fps-on-windows 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…