From 4e766280c4481d23a64a1c80c0ec40d7cf1ff378 Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Sun, 30 Jan 2022 12:36:56 -0500 Subject: common: wall_clock: Utilize constants for ms, us, and ns ratios --- src/common/wall_clock.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/wall_clock.cpp') diff --git a/src/common/wall_clock.cpp b/src/common/wall_clock.cpp index ffa282e88..081e0562f 100644 --- a/src/common/wall_clock.cpp +++ b/src/common/wall_clock.cpp @@ -73,8 +73,8 @@ std::unique_ptr CreateBestMatchingClock(u32 emulated_cpu_frequency, rtsc_frequency = EstimateRDTSCFrequency(); } - // Fallback to StandardWallClock if rtsc period is higher than a nano second - if (rtsc_frequency <= 1000000000) { + // Fallback to StandardWallClock if the hardware TSC does not have nanosecond precision. + if (rtsc_frequency <= WallClock::NS_RATIO) { return std::make_unique(emulated_cpu_frequency, emulated_clock_frequency); } else { -- cgit v1.2.3