summaryrefslogtreecommitdiff
path: root/src/common/x64/native_clock.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/x64/native_clock.h')
-rw-r--r--src/common/x64/native_clock.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/common/x64/native_clock.h b/src/common/x64/native_clock.h
index 046cea095..38ae7a462 100644
--- a/src/common/x64/native_clock.h
+++ b/src/common/x64/native_clock.h
@@ -3,7 +3,6 @@
3 3
4#pragma once 4#pragma once
5 5
6#include <atomic>
7#include "common/wall_clock.h" 6#include "common/wall_clock.h"
8 7
9namespace Common { 8namespace Common {
@@ -29,12 +28,17 @@ public:
29private: 28private:
30 u64 GetRTSC(); 29 u64 GetRTSC();
31 30
32 struct alignas(16) TimePoint { 31 union alignas(16) TimePoint {
33 u64 last_measure{}; 32 TimePoint() : pack{} {}
34 u64 accumulated_ticks{}; 33 u128 pack{};
34 struct Inner {
35 u64 last_measure{};
36 u64 accumulated_ticks{};
37 } inner;
35 }; 38 };
36 39
37 std::atomic<TimePoint> time_point; 40 TimePoint time_point;
41
38 // factors 42 // factors
39 u64 clock_rtsc_factor{}; 43 u64 clock_rtsc_factor{};
40 u64 cpu_rtsc_factor{}; 44 u64 cpu_rtsc_factor{};