core: move to steady_clock where applicable

avoid issues when system clock gets desynchronized or changed
This commit is contained in:
Vaxry
2024-06-25 16:05:39 +02:00
parent 918d8340af
commit 1d70962892
10 changed files with 31 additions and 31 deletions

View File

@@ -552,7 +552,7 @@ void CAnimationManager::scheduleTick() {
float refreshDelayMs = std::floor(1000.f / PMOSTHZ->refreshRate);
const float SINCEPRES = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::system_clock::now() - PMOSTHZ->lastPresentationTimer.chrono()).count() / 1000.f;
const float SINCEPRES = std::chrono::duration_cast<std::chrono::microseconds>(std::chrono::steady_clock::now() - PMOSTHZ->lastPresentationTimer.chrono()).count() / 1000.f;
const auto TOPRES = std::clamp(refreshDelayMs - SINCEPRES, 1.1f, 1000.f); // we can't send 0, that will disarm it