diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-02-10 16:20:40 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-06-18 22:29:18 +0200 |
commit | e3524d114246a9221c766bdf1992777b208cbd67 (patch) | |
tree | 1454fe38bdafd94ada74ae5f1209a7466bbf4e78 /src/common/wall_clock.h | |
parent | Common: Implement WallClock Interface and implement a native clock for x64 (diff) | |
download | yuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar yuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar.gz yuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar.bz2 yuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar.lz yuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar.xz yuzu-e3524d114246a9221c766bdf1992777b208cbd67.tar.zst yuzu-e3524d114246a9221c766bdf1992777b208cbd67.zip |
Diffstat (limited to 'src/common/wall_clock.h')
-rw-r--r-- | src/common/wall_clock.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/common/wall_clock.h b/src/common/wall_clock.h index 6f763d74b..fc34429bb 100644 --- a/src/common/wall_clock.h +++ b/src/common/wall_clock.h @@ -5,6 +5,7 @@ #pragma once #include <chrono> +#include <memory> #include "common/common_types.h" @@ -12,10 +13,20 @@ namespace Common { class WallClock { public: + + /// Returns current wall time in nanoseconds virtual std::chrono::nanoseconds GetTimeNS() = 0; + + /// Returns current wall time in microseconds virtual std::chrono::microseconds GetTimeUS() = 0; + + /// Returns current wall time in milliseconds virtual std::chrono::milliseconds GetTimeMS() = 0; + + /// Returns current wall time in emulated clock cycles virtual u64 GetClockCycles() = 0; + + /// Returns current wall time in emulated cpu cycles virtual u64 GetCPUCycles() = 0; /// Tells if the wall clock, uses the host CPU's hardware clock @@ -35,6 +46,6 @@ private: bool is_native; }; -WallClock* CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_clock_frequency); +std::unique_ptr<WallClock> CreateBestMatchingClock(u32 emulated_cpu_frequency, u32 emulated_clock_frequency); } // namespace Common |