summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2022-10-12 15:35:06 -0700
committerGravatar GitHub2022-10-12 15:35:06 -0700
commit0b9f2c2f14fef10d8121e004a265bc3c5af93b52 (patch)
treedb32b6a0949b49b6806f246d134e6abc0b91eec5 /src
parentMerge pull request #9024 from liamwhite/async-screenshot (diff)
parentcore_timing: use high-precision sleeps on non-Windows targets (diff)
downloadyuzu-0b9f2c2f14fef10d8121e004a265bc3c5af93b52.tar.gz
yuzu-0b9f2c2f14fef10d8121e004a265bc3c5af93b52.tar.xz
yuzu-0b9f2c2f14fef10d8121e004a265bc3c5af93b52.zip
Merge pull request #9040 from liamwhite/woe-thirty-two
core_timing: use high-precision sleeps on non-Windows targets
Diffstat (limited to 'src')
-rw-r--r--src/core/core_timing.cpp4
1 files changed, 4 insertions, 0 deletions
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() {
270 // There are more events left in the queue, wait until the next event. 270 // There are more events left in the queue, wait until the next event.
271 const auto wait_time = *next_time - GetGlobalTimeNs().count(); 271 const auto wait_time = *next_time - GetGlobalTimeNs().count();
272 if (wait_time > 0) { 272 if (wait_time > 0) {
273#ifdef _WIN32
273 // Assume a timer resolution of 1ms. 274 // Assume a timer resolution of 1ms.
274 static constexpr s64 TimerResolutionNS = 1000000; 275 static constexpr s64 TimerResolutionNS = 1000000;
275 276
@@ -287,6 +288,9 @@ void CoreTiming::ThreadLoop() {
287 if (event.IsSet()) { 288 if (event.IsSet()) {
288 event.Reset(); 289 event.Reset();
289 } 290 }
291#else
292 event.WaitFor(std::chrono::nanoseconds(wait_time));
293#endif
290 } 294 }
291 } else { 295 } else {
292 // Queue is empty, wait until another event is scheduled and signals us to continue. 296 // Queue is empty, wait until another event is scheduled and signals us to continue.