aboutsummaryrefslogtreecommitdiff
path: root/src/common/wall_clock.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-01-30 12:36:56 -0500
committerMorph <39850852+Morph1984@users.noreply.github.com>2022-01-30 12:36:56 -0500
commitfe2ff6b8a1ed3d03f802eddee5921f900bc5b1b0 (patch)
tree85f078d686978b4b27fc44c7cf0b95a90a6cc4bf /src/common/wall_clock.cpp
parentb7d23543b4c79a3d3dedb0cd582340f724fba526 (diff)
common: wall_clock: Utilize constants for ms, us, and ns ratios
Diffstat (limited to 'src/common/wall_clock.cpp')
-rw-r--r--src/common/wall_clock.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/wall_clock.cpp b/src/common/wall_clock.cpp
index ffa282e888..081e0562ff 100644
--- a/src/common/wall_clock.cpp
+++ b/src/common/wall_clock.cpp
@@ -73,8 +73,8 @@ std::unique_ptr<WallClock> 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<StandardWallClock>(emulated_cpu_frequency,
emulated_clock_frequency);
} else {