diff options
| author | 2021-12-03 16:08:20 -0800 | |
|---|---|---|
| committer | 2021-12-03 16:08:20 -0800 | |
| commit | a2fb5a13b2b00922d1f4fcc6dc41849704fa0f89 (patch) | |
| tree | 8feb52b4bd0afa965b0865ef00e5f8739b07d3df /src/common/x64/native_clock.cpp | |
| parent | Merge pull request #7490 from Morph1984/stub-album-save-screenshot (diff) | |
| parent | general: Replace high_resolution_clock with steady_clock (diff) | |
| download | yuzu-a2fb5a13b2b00922d1f4fcc6dc41849704fa0f89.tar.gz yuzu-a2fb5a13b2b00922d1f4fcc6dc41849704fa0f89.tar.xz yuzu-a2fb5a13b2b00922d1f4fcc6dc41849704fa0f89.zip | |
Merge pull request #7489 from Morph1984/steady-clock
general: Replace high_resolution_clock with steady_clock
Diffstat (limited to 'src/common/x64/native_clock.cpp')
| -rw-r--r-- | src/common/x64/native_clock.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 87de40624..28f834443 100644 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp | |||
| @@ -19,16 +19,16 @@ u64 EstimateRDTSCFrequency() { | |||
| 19 | // get current time | 19 | // get current time |
| 20 | _mm_mfence(); | 20 | _mm_mfence(); |
| 21 | const u64 tscStart = __rdtsc(); | 21 | const u64 tscStart = __rdtsc(); |
| 22 | const auto startTime = std::chrono::high_resolution_clock::now(); | 22 | const auto startTime = std::chrono::steady_clock::now(); |
| 23 | // wait roughly 3 seconds | 23 | // wait roughly 3 seconds |
| 24 | while (true) { | 24 | while (true) { |
| 25 | auto milli = std::chrono::duration_cast<std::chrono::milliseconds>( | 25 | auto milli = std::chrono::duration_cast<std::chrono::milliseconds>( |
| 26 | std::chrono::high_resolution_clock::now() - startTime); | 26 | std::chrono::steady_clock::now() - startTime); |
| 27 | if (milli.count() >= 3000) | 27 | if (milli.count() >= 3000) |
| 28 | break; | 28 | break; |
| 29 | std::this_thread::sleep_for(milli_10); | 29 | std::this_thread::sleep_for(milli_10); |
| 30 | } | 30 | } |
| 31 | const auto endTime = std::chrono::high_resolution_clock::now(); | 31 | const auto endTime = std::chrono::steady_clock::now(); |
| 32 | _mm_mfence(); | 32 | _mm_mfence(); |
| 33 | const u64 tscEnd = __rdtsc(); | 33 | const u64 tscEnd = __rdtsc(); |
| 34 | // calculate difference | 34 | // calculate difference |