diff options
| author | bunnei <bunneidev@gmail.com> | 2022-02-01 18:34:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-02-01 18:34:31 -0700 |
| commit | 50e9ba34b49a5440487529bece8cbf15b78f8df0 (patch) | |
| tree | 48fc259e944baa16a401e52a25eb4eb6ac236d63 /src/common/wall_clock.h | |
| parent | a28a10bc546c2e4bfa693b49fd40b7578e69decb (diff) | |
| parent | 6267110b694d3b3f8a8561c61ad6b4a4548873b5 (diff) | |
Merge pull request #7809 from Morph1984/clock-constants
common: wall_clock: Utilize constants for ms, us, and ns ratios
Diffstat (limited to 'src/common/wall_clock.h')
| -rw-r--r-- | src/common/wall_clock.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/wall_clock.h b/src/common/wall_clock.h index cef3e9499..874448c27 100644 --- a/src/common/wall_clock.h +++ b/src/common/wall_clock.h @@ -13,6 +13,10 @@ namespace Common { class WallClock { public: + static constexpr u64 NS_RATIO = 1'000'000'000; + static constexpr u64 US_RATIO = 1'000'000; + static constexpr u64 MS_RATIO = 1'000; + virtual ~WallClock() = default; /// Returns current wall time in nanoseconds @@ -49,7 +53,7 @@ private: bool is_native; }; -[[nodiscard]] std::unique_ptr<WallClock> CreateBestMatchingClock(u32 emulated_cpu_frequency, - u32 emulated_clock_frequency); +[[nodiscard]] std::unique_ptr<WallClock> CreateBestMatchingClock(u64 emulated_cpu_frequency, + u64 emulated_clock_frequency); } // namespace Common |
