15 #if defined(CLOCK_MONOTONIC_RAW) && defined(__unix__)
16 #define USE_CLOCK_MONOTONIC_RAW 1
18 #define USE_CLOCK_MONOTONIC_RAW 0
21 #if USE_CLOCK_MONOTONIC_RAW
22 class MonotonicClockRaw
25 using duration = std::chrono::nanoseconds;
26 using time_point = std::chrono::time_point<MonotonicClockRaw, duration>;
28 static std::chrono::time_point<MonotonicClockRaw, std::chrono::nanoseconds> now() noexcept
31 clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
32 return time_point(std::chrono::nanoseconds(ts.tv_sec * 1000000000 + ts.tv_nsec));
46 void Start()
override;
52 const char*
GetName()
const override;
57 #if USE_CLOCK_MONOTONIC_RAW
58 using clock = MonotonicClockRaw;
60 using clock = std::chrono::steady_clock;
68 clock::time_point m_Start;
69 clock::time_point m_Stop;