diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-06-25 16:05:39 +0200 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-06-25 16:05:47 +0200 |
| commit | 1d70962892a6e3e1cacd3663b390bbdf81426984 (patch) | |
| tree | 168f9049a02e8ecf704fa49f214810b95575240a /src/managers/AnimationManager.cpp | |
| parent | 918d8340afd652b011b937d29d5eea0be08467f5 (diff) | |
core: move to steady_clock where applicable
avoid issues when system clock gets desynchronized or changed
Diffstat (limited to 'src/managers/AnimationManager.cpp')
| -rw-r--r-- | src/managers/AnimationManager.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index 9d6668c9..1fec375e 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -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 |
