From 781adc81036b0ba4174f69fff4d071bedcd2eb43 Mon Sep 17 00:00:00 2001 From: yuzubot Date: Mon, 10 Oct 2022 12:02:41 +0000 Subject: [PATCH] "Merge Tagged PR 9040" --- src/core/core_timing.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 6c0fcb7b5..2678ce532 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -270,6 +270,7 @@ void CoreTiming::ThreadLoop() { // There are more events left in the queue, wait until the next event. const auto wait_time = *next_time - GetGlobalTimeNs().count(); if (wait_time > 0) { +#ifdef _WIN32 // Assume a timer resolution of 1ms. static constexpr s64 TimerResolutionNS = 1000000; @@ -287,6 +288,9 @@ void CoreTiming::ThreadLoop() { if (event.IsSet()) { event.Reset(); } +#else + event.WaitFor(std::chrono::nanoseconds(wait_time)); +#endif } } else { // Queue is empty, wait until another event is scheduled and signals us to continue.