diff options
| author | Morph <39850852+Morph1984@users.noreply.github.com> | 2022-01-28 20:04:24 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-28 20:04:24 -0500 |
| commit | b7d23543b4c79a3d3dedb0cd582340f724fba526 (patch) | |
| tree | d89af13af3a1538f9fe676cdf58a3baec7a22fb0 /src/common/wall_clock.cpp | |
| parent | a1e790d3cbe69de4f6266b05bb174e780823c793 (diff) | |
| parent | c092488c53cc0e87b5831ec1c72a2653bc07499e (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.cpp | 4 |
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 { |
