1
0
Fork 0
forked from suyu/suyu
suyu/src/common/steady_clock.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
788 B
C++
Raw Normal View History

// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
2024-03-05 09:42:40 +01:00
// 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;
};
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