aboutsummaryrefslogtreecommitdiff
path: root/src/common/steady_clock.h
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2023-03-04 22:59:04 -0500
committerMorph <39850852+Morph1984@users.noreply.github.com>2023-03-07 21:17:46 -0500
commitc3855de299f660e00ac8b017704b9a1d286ce2ad (patch)
tree4eebfe3a97560e36c2f2653a15633a24b8b17daf /src/common/steady_clock.h
parentafa678be3a38dd4966ab0803fe21af124761b27b (diff)
steady_clock: Introduce a real time clock
Diffstat (limited to 'src/common/steady_clock.h')
-rw-r--r--src/common/steady_clock.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/steady_clock.h b/src/common/steady_clock.h
index 9497cf865d..dbd0e25131 100644
--- a/src/common/steady_clock.h
+++ b/src/common/steady_clock.h
@@ -20,4 +20,15 @@ struct SteadyClock {
[[nodiscard]] static time_point Now() noexcept;
};
+struct RealTimeClock {
+ using rep = s64;
+ using period = std::nano;
+ using duration = std::chrono::nanoseconds;
+ using time_point = std::chrono::time_point<RealTimeClock>;
+
+ static constexpr bool is_steady = false;
+
+ [[nodiscard]] static time_point Now() noexcept;
+};
+
} // namespace Common