summaryrefslogtreecommitdiff
path: root/src/common/wall_clock.h
diff options
context:
space:
mode:
authorGravatar Morph2023-03-01 21:06:19 -0500
committerGravatar Morph2023-03-05 02:36:31 -0500
commitbff14532825e7517882ca913738347059f73cf7f (patch)
treef21f509d4c7458a79e2fc399c1de3036a7efd51d /src/common/wall_clock.h
parentmain: (Windows) Set the current timer resolution to the maximum (diff)
downloadyuzu-bff14532825e7517882ca913738347059f73cf7f.tar.gz
yuzu-bff14532825e7517882ca913738347059f73cf7f.tar.xz
yuzu-bff14532825e7517882ca913738347059f73cf7f.zip
core_timing: Use higher precision sleeps on Windows
The precision of sleep_for and wait_for is limited to 1-1.5ms on Windows. Using SleepForOneTick() allows us to sleep for exactly one interval of the current timer resolution. This allows us to take advantage of systems that have a timer resolution of 0.5ms to reduce CPU overhead in the event loop.
Diffstat (limited to 'src/common/wall_clock.h')
-rw-r--r--src/common/wall_clock.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/common/wall_clock.h b/src/common/wall_clock.h
index 828a523a8..157ec5eae 100644
--- a/src/common/wall_clock.h
+++ b/src/common/wall_clock.h
@@ -55,4 +55,7 @@ private:
55[[nodiscard]] std::unique_ptr<WallClock> CreateBestMatchingClock(u64 emulated_cpu_frequency, 55[[nodiscard]] std::unique_ptr<WallClock> CreateBestMatchingClock(u64 emulated_cpu_frequency,
56 u64 emulated_clock_frequency); 56 u64 emulated_clock_frequency);
57 57
58[[nodiscard]] std::unique_ptr<WallClock> CreateStandardWallClock(u64 emulated_cpu_frequency,
59 u64 emulated_clock_frequency);
60
58} // namespace Common 61} // namespace Common