diff options
author | liamwhite <liamwhite@users.noreply.github.com> | 2023-03-07 10:54:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-07 10:54:13 -0500 |
commit | a7792e5ff83523142230951ac7eacbd7685dc40b (patch) | |
tree | a7531c65e2ddec1122fc071d44c8106c48352ce3 /src/common/steady_clock.h | |
parent | 6d61430311d57fa4338bcf33cdcbb04a9a2f16c4 (diff) | |
parent | 376a414f5bc6d27e5e0fbda323caf5520436bf39 (diff) |
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 @@ +// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include <chrono> + +#include "common/common_types.h" + +namespace Common { + +struct SteadyClock { + using rep = s64; + using period = std::nano; + using duration = std::chrono::nanoseconds; + using time_point = std::chrono::time_point<SteadyClock>; + + static constexpr bool is_steady = true; + + [[nodiscard]] static time_point Now() noexcept; +}; + +} // namespace Common |