aboutsummaryrefslogtreecommitdiff
path: root/src/common/wall_clock.cpp
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-01-28 20:04:24 -0500
committerGitHub <noreply@github.com>2022-01-28 20:04:24 -0500
commitb7d23543b4c79a3d3dedb0cd582340f724fba526 (patch)
treed89af13af3a1538f9fe676cdf58a3baec7a22fb0 /src/common/wall_clock.cpp
parenta1e790d3cbe69de4f6266b05bb174e780823c793 (diff)
parentc092488c53cc0e87b5831ec1c72a2653bc07499e (diff)
Merge pull request #7791 from german77/wall_clock
wall_clock: Use standard wall clock if rtsc frequency is too low
Diffstat (limited to 'src/common/wall_clock.cpp')
-rw-r--r--src/common/wall_clock.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/wall_clock.cpp b/src/common/wall_clock.cpp
index 49830b8ab6..ffa282e888 100644
--- a/src/common/wall_clock.cpp
+++ b/src/common/wall_clock.cpp
@@ -72,7 +72,9 @@ std::unique_ptr<WallClock> CreateBestMatchingClock(u32 emulated_cpu_frequency,
if (caps.invariant_tsc) {
rtsc_frequency = EstimateRDTSCFrequency();
}
- if (rtsc_frequency == 0) {
+
+ // Fallback to StandardWallClock if rtsc period is higher than a nano second
+ if (rtsc_frequency <= 1000000000) {
return std::make_unique<StandardWallClock>(emulated_cpu_frequency,
emulated_clock_frequency);
} else {