Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static const long long BASE_DELAY = 1000 / GAMELOOP_FPS;
- void GameThread::_wait()
- {
- std::chrono::steady_clock::time_point curTime = std::chrono::steady_clock::now();
- long long delay = BASE_DELAY - std::chrono::duration_cast<std::chrono::milliseconds>(curTime - _lastRunTime).count();
- if (delay > 0)
- QThread::msleep(delay);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement