diff options
author | bunnei <bunneidev@gmail.com> | 2018-07-30 14:13:56 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-30 14:13:56 -0700 |
commit | 05ee92a35783ace09fd75e61899c8820021bc6ef (patch) | |
tree | a7431438fcfd6f48b7dbe6b1a665aa44cc9bb7dc /src/common/timer.h | |
parent | e6b08b22098e3be4ff1447167f520744b4eb3ea2 (diff) | |
parent | 38a11136744b814b12036527f84b71eae0ef6ea6 (diff) |
Merge pull request #861 from FearlessTobi/port-3972
Port #3972 from Citra: "common/timer: use std::chrono, avoid platform-dependent code"
Diffstat (limited to 'src/common/timer.h')
-rw-r--r-- | src/common/timer.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/common/timer.h b/src/common/timer.h index 78d37426b4..27b521baac 100644 --- a/src/common/timer.h +++ b/src/common/timer.h @@ -4,6 +4,7 @@ #pragma once +#include <chrono> #include <string> #include "common/common_types.h" @@ -18,24 +19,22 @@ public: // The time difference is always returned in milliseconds, regardless of alternative internal // representation - u64 GetTimeDifference(); + std::chrono::milliseconds GetTimeDifference(); void AddTimeDifference(); - static void IncreaseResolution(); - static void RestoreResolution(); - static u64 GetTimeSinceJan1970(); - static u64 GetLocalTimeSinceJan1970(); + static std::chrono::seconds GetTimeSinceJan1970(); + static std::chrono::seconds GetLocalTimeSinceJan1970(); static double GetDoubleTime(); static std::string GetTimeFormatted(); std::string GetTimeElapsedFormatted() const; - u64 GetTimeElapsed(); + std::chrono::milliseconds GetTimeElapsed(); - static u32 GetTimeMs(); + static std::chrono::milliseconds GetTimeMs(); private: - u64 m_LastTime; - u64 m_StartTime; + std::chrono::milliseconds m_LastTime; + std::chrono::milliseconds m_StartTime; bool m_Running; }; |