diff options
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 78d37426b..27b521baa 100644 --- a/src/common/timer.h +++ b/src/common/timer.h | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include <chrono> | ||
| 7 | #include <string> | 8 | #include <string> |
| 8 | #include "common/common_types.h" | 9 | #include "common/common_types.h" |
| 9 | 10 | ||
| @@ -18,24 +19,22 @@ public: | |||
| 18 | 19 | ||
| 19 | // The time difference is always returned in milliseconds, regardless of alternative internal | 20 | // The time difference is always returned in milliseconds, regardless of alternative internal |
| 20 | // representation | 21 | // representation |
| 21 | u64 GetTimeDifference(); | 22 | std::chrono::milliseconds GetTimeDifference(); |
| 22 | void AddTimeDifference(); | 23 | void AddTimeDifference(); |
| 23 | 24 | ||
| 24 | static void IncreaseResolution(); | 25 | static std::chrono::seconds GetTimeSinceJan1970(); |
| 25 | static void RestoreResolution(); | 26 | static std::chrono::seconds GetLocalTimeSinceJan1970(); |
| 26 | static u64 GetTimeSinceJan1970(); | ||
| 27 | static u64 GetLocalTimeSinceJan1970(); | ||
| 28 | static double GetDoubleTime(); | 27 | static double GetDoubleTime(); |
| 29 | 28 | ||
| 30 | static std::string GetTimeFormatted(); | 29 | static std::string GetTimeFormatted(); |
| 31 | std::string GetTimeElapsedFormatted() const; | 30 | std::string GetTimeElapsedFormatted() const; |
| 32 | u64 GetTimeElapsed(); | 31 | std::chrono::milliseconds GetTimeElapsed(); |
| 33 | 32 | ||
| 34 | static u32 GetTimeMs(); | 33 | static std::chrono::milliseconds GetTimeMs(); |
| 35 | 34 | ||
| 36 | private: | 35 | private: |
| 37 | u64 m_LastTime; | 36 | std::chrono::milliseconds m_LastTime; |
| 38 | u64 m_StartTime; | 37 | std::chrono::milliseconds m_StartTime; |
| 39 | bool m_Running; | 38 | bool m_Running; |
| 40 | }; | 39 | }; |
| 41 | 40 | ||