diff options
Diffstat (limited to 'src/common/x64/native_clock.cpp')
| -rw-r--r-- | src/common/x64/native_clock.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/x64/native_clock.cpp b/src/common/x64/native_clock.cpp index 5d1eb0590..7d2a26bd9 100644 --- a/src/common/x64/native_clock.cpp +++ b/src/common/x64/native_clock.cpp | |||
| @@ -12,7 +12,8 @@ NativeClock::NativeClock(u64 rdtsc_frequency_) | |||
| 12 | ns_rdtsc_factor{GetFixedPoint64Factor(NsRatio::den, rdtsc_frequency)}, | 12 | ns_rdtsc_factor{GetFixedPoint64Factor(NsRatio::den, rdtsc_frequency)}, |
| 13 | us_rdtsc_factor{GetFixedPoint64Factor(UsRatio::den, rdtsc_frequency)}, | 13 | us_rdtsc_factor{GetFixedPoint64Factor(UsRatio::den, rdtsc_frequency)}, |
| 14 | ms_rdtsc_factor{GetFixedPoint64Factor(MsRatio::den, rdtsc_frequency)}, | 14 | ms_rdtsc_factor{GetFixedPoint64Factor(MsRatio::den, rdtsc_frequency)}, |
| 15 | cntpct_rdtsc_factor{GetFixedPoint64Factor(CNTFRQ, rdtsc_frequency)} {} | 15 | cntpct_rdtsc_factor{GetFixedPoint64Factor(CNTFRQ, rdtsc_frequency)}, |
| 16 | gputick_rdtsc_factor{GetFixedPoint64Factor(GPUTickFreq, rdtsc_frequency)} {} | ||
| 16 | 17 | ||
| 17 | std::chrono::nanoseconds NativeClock::GetTimeNS() const { | 18 | std::chrono::nanoseconds NativeClock::GetTimeNS() const { |
| 18 | return std::chrono::nanoseconds{MultiplyHigh(GetHostTicksElapsed(), ns_rdtsc_factor)}; | 19 | return std::chrono::nanoseconds{MultiplyHigh(GetHostTicksElapsed(), ns_rdtsc_factor)}; |
| @@ -30,6 +31,10 @@ u64 NativeClock::GetCNTPCT() const { | |||
| 30 | return MultiplyHigh(GetHostTicksElapsed(), cntpct_rdtsc_factor); | 31 | return MultiplyHigh(GetHostTicksElapsed(), cntpct_rdtsc_factor); |
| 31 | } | 32 | } |
| 32 | 33 | ||
| 34 | u64 NativeClock::GetGPUTick() const { | ||
| 35 | return MultiplyHigh(GetHostTicksElapsed(), gputick_rdtsc_factor); | ||
| 36 | } | ||
| 37 | |||
| 33 | u64 NativeClock::GetHostTicksNow() const { | 38 | u64 NativeClock::GetHostTicksNow() const { |
| 34 | return FencedRDTSC(); | 39 | return FencedRDTSC(); |
| 35 | } | 40 | } |