diff options
| author | 2023-03-04 22:59:04 -0500 | |
|---|---|---|
| committer | 2023-03-07 21:17:46 -0500 | |
| commit | 6f9918552c6a1d56a21fa544a7776cd1e5af7bc4 (patch) | |
| tree | 4eebfe3a97560e36c2f2653a15633a24b8b17daf /src/common/steady_clock.h | |
| parent | native_clock: Re-adjust the RDTSC frequency (diff) | |
| download | yuzu-6f9918552c6a1d56a21fa544a7776cd1e5af7bc4.tar.gz yuzu-6f9918552c6a1d56a21fa544a7776cd1e5af7bc4.tar.xz yuzu-6f9918552c6a1d56a21fa544a7776cd1e5af7bc4.zip | |
steady_clock: Introduce a real time clock
Diffstat (limited to 'src/common/steady_clock.h')
| -rw-r--r-- | src/common/steady_clock.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common/steady_clock.h b/src/common/steady_clock.h index 9497cf865..dbd0e2513 100644 --- a/src/common/steady_clock.h +++ b/src/common/steady_clock.h | |||
| @@ -20,4 +20,15 @@ struct SteadyClock { | |||
| 20 | [[nodiscard]] static time_point Now() noexcept; | 20 | [[nodiscard]] static time_point Now() noexcept; |
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | struct RealTimeClock { | ||
| 24 | using rep = s64; | ||
| 25 | using period = std::nano; | ||
| 26 | using duration = std::chrono::nanoseconds; | ||
| 27 | using time_point = std::chrono::time_point<RealTimeClock>; | ||
| 28 | |||
| 29 | static constexpr bool is_steady = false; | ||
| 30 | |||
| 31 | [[nodiscard]] static time_point Now() noexcept; | ||
| 32 | }; | ||
| 33 | |||
| 23 | } // namespace Common | 34 | } // namespace Common |