When I locked the framerate, I was assuming that to stay at 60 FPS, you take the amount of time 60FPS would be in microseconds minus the time it took to actually process the frame and sleep that long; however, it doesn't work for me.
uint64_t allocFrameTime = 1000000 / SEV_Framelock;
if (between < allocFrameTime)
sf::sleep(sf::microseconds(allocFrameTime - between));
between is of course the time the frame took to process in microseconds, and SEV_Framelock is 60. However, when I use this code, the game runs at ~100 fps. Uncapped, it reaches ~900 FPS. What am I doing wrong? I don't want it capped at 100, I want it at 60.