From 2e5484498933b69b4d1e86f2cfafd17bbaa52871 Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Sat, 17 Aug 2024 18:07:21 +0200 Subject: [PATCH] Use steady_clock instead of high_resolution_clock for sleeping. --- source/mijin/async/coroutine_sleep.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/mijin/async/coroutine_sleep.hpp b/source/mijin/async/coroutine_sleep.hpp index 829e9e7..bda029d 100644 --- a/source/mijin/async/coroutine_sleep.hpp +++ b/source/mijin/async/coroutine_sleep.hpp @@ -13,12 +13,12 @@ namespace mijin template Task<> c_sleep(std::chrono::duration duration) { - auto now = std::chrono::high_resolution_clock::now(); + auto now = std::chrono::steady_clock::now(); const auto end = now + duration; while (now < end) { co_await c_suspend(); - now = std::chrono::high_resolution_clock::now(); + now = std::chrono::steady_clock::now(); } co_return; }