summaryrefslogtreecommitdiff
path: root/src/core/core_timing.cpp
diff options
context:
space:
mode:
authorGravatar liamwhite2023-03-28 09:09:35 -0400
committerGravatar GitHub2023-03-28 09:09:35 -0400
commit40efd2ab56c2296da4524085a133021f7731e67f (patch)
treea43b51a4056ad7664346a63f145c889da1f59d16 /src/core/core_timing.cpp
parentMerge pull request #10002 from german77/log (diff)
parenttelemetry: Add waitpkg instruction (diff)
downloadyuzu-40efd2ab56c2296da4524085a133021f7731e67f.tar.gz
yuzu-40efd2ab56c2296da4524085a133021f7731e67f.tar.xz
yuzu-40efd2ab56c2296da4524085a133021f7731e67f.zip
Merge pull request #9982 from Morph1984/tpause
x64: Make use of waitpkg instructions for power efficient sleeps
Diffstat (limited to 'src/core/core_timing.cpp')
-rw-r--r--src/core/core_timing.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp
index cd4df4522..4f2692b05 100644
--- a/src/core/core_timing.cpp
+++ b/src/core/core_timing.cpp
@@ -10,6 +10,10 @@
10#include "common/windows/timer_resolution.h" 10#include "common/windows/timer_resolution.h"
11#endif 11#endif
12 12
13#ifdef ARCHITECTURE_x86_64
14#include "common/x64/cpu_wait.h"
15#endif
16
13#include "common/microprofile.h" 17#include "common/microprofile.h"
14#include "core/core_timing.h" 18#include "core/core_timing.h"
15#include "core/core_timing_util.h" 19#include "core/core_timing_util.h"
@@ -269,7 +273,11 @@ void CoreTiming::ThreadLoop() {
269 if (wait_time >= timer_resolution_ns) { 273 if (wait_time >= timer_resolution_ns) {
270 Common::Windows::SleepForOneTick(); 274 Common::Windows::SleepForOneTick();
271 } else { 275 } else {
276#ifdef ARCHITECTURE_x86_64
277 Common::X64::MicroSleep();
278#else
272 std::this_thread::yield(); 279 std::this_thread::yield();
280#endif
273 } 281 }
274 } 282 }
275 283