diff options
Diffstat (limited to 'src/common/x64/native_clock.cpp')
| -rw-r--r-- | src/common/x64/native_clock.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 26d4d0ba6..926f92ff8 100644 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp | |||
| @@ -65,6 +65,13 @@ u64 NativeClock::GetRTSC() { | |||
| 65 | return accumulated_ticks; | 65 | return accumulated_ticks; |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | void NativeClock::Pause(bool is_paused) { | ||
| 69 | if (!is_paused) { | ||
| 70 | _mm_mfence(); | ||
| 71 | last_measure = __rdtsc(); | ||
| 72 | } | ||
| 73 | } | ||
| 74 | |||
| 68 | std::chrono::nanoseconds NativeClock::GetTimeNS() { | 75 | std::chrono::nanoseconds NativeClock::GetTimeNS() { |
| 69 | const u64 rtsc_value = GetRTSC(); | 76 | const u64 rtsc_value = GetRTSC(); |
| 70 | return std::chrono::nanoseconds{MultiplyAndDivide64(rtsc_value, 1000000000, rtsc_frequency)}; | 77 | return std::chrono::nanoseconds{MultiplyAndDivide64(rtsc_value, 1000000000, rtsc_frequency)}; |