Limit while loop to run at 30 “FPS” using a delta variable C++
问题 I basically need a while loop to only run at 30 "FPS". I was told to do this: "Inside your while loop, make a deltaT , and if that deltaT is lesser than 33 miliseconds use sleep(33-deltaT) ." But I really wasn't quite sure how to initialize the delta/what to set this variable to. I also couldn't get a reply back from the person that suggested this. I'm also not sure why the value in sleep is 33 instead of 30. Does anyone know what I can do about this? This is mainly for a game server to