33 lines
603 B
C
33 lines
603 B
C
|
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||
|
|
||
|
#pragma once
|
||
|
|
||
|
#include <chrono>
|
||
|
#include "common/types.h"
|
||
|
|
||
|
namespace Common {
|
||
|
|
||
|
class NativeClock final {
|
||
|
public:
|
||
|
explicit NativeClock();
|
||
|
|
||
|
u64 GetTscFrequency() const {
|
||
|
return rdtsc_frequency;
|
||
|
}
|
||
|
|
||
|
u64 GetTimeNS() const;
|
||
|
u64 GetTimeUS() const;
|
||
|
u64 GetTimeMS() const;
|
||
|
u64 GetUptime() const;
|
||
|
u64 GetProcessTimeUS() const;
|
||
|
|
||
|
private:
|
||
|
u64 rdtsc_frequency;
|
||
|
u64 ns_rdtsc_factor;
|
||
|
u64 us_rdtsc_factor;
|
||
|
u64 ms_rdtsc_factor;
|
||
|
};
|
||
|
|
||
|
} // namespace Common
|