diff options
| author | 2023-03-07 10:54:13 -0500 | |
|---|---|---|
| committer | 2023-03-07 10:54:13 -0500 | |
| commit | a7792e5ff83523142230951ac7eacbd7685dc40b (patch) | |
| tree | a7531c65e2ddec1122fc071d44c8106c48352ce3 /src/common/steady_clock.h | |
| parent | Merge pull request #9890 from Kelebek1/reverb_fix (diff) | |
| parent | native_clock: Round RDTSC frequency to the nearest 1000 (diff) | |
| download | yuzu-a7792e5ff83523142230951ac7eacbd7685dc40b.tar.gz yuzu-a7792e5ff83523142230951ac7eacbd7685dc40b.tar.xz yuzu-a7792e5ff83523142230951ac7eacbd7685dc40b.zip | |
Merge pull request #9889 from Morph1984/time-is-ticking
core_timing: Reduce CPU usage on Windows
Diffstat (limited to 'src/common/steady_clock.h')
| -rw-r--r-- | src/common/steady_clock.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/common/steady_clock.h b/src/common/steady_clock.h new file mode 100644 index 000000000..9497cf865 --- /dev/null +++ b/src/common/steady_clock.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include <chrono> | ||
| 7 | |||
| 8 | #include "common/common_types.h" | ||
| 9 | |||
| 10 | namespace Common { | ||
| 11 | |||
| 12 | struct SteadyClock { | ||
| 13 | using rep = s64; | ||
| 14 | using period = std::nano; | ||
| 15 | using duration = std::chrono::nanoseconds; | ||
| 16 | using time_point = std::chrono::time_point<SteadyClock>; | ||
| 17 | |||
| 18 | static constexpr bool is_steady = true; | ||
| 19 | |||
| 20 | [[nodiscard]] static time_point Now() noexcept; | ||
| 21 | }; | ||
| 22 | |||
| 23 | } // namespace Common | ||