core_timing: Make GetGlobalTimeUs() return std::chrono::microseconds

Enforces the time unit being returned and also allows using the standard
time utilities to manipulate it.
This commit is contained in:
Lioncash 2018-08-05 22:07:28 -04:00
parent c8e5c74092
commit a0c3a46aa9
4 changed files with 14 additions and 14 deletions

View file

@ -33,7 +33,7 @@ public:
void EndSystemFrame();
void EndGameFrame();
Results GetAndResetStats(u64 current_system_time_us);
Results GetAndResetStats(std::chrono::microseconds current_system_time_us);
/**
* Gets the ratio between walltime and the emulated time of the previous system frame. This is
@ -47,7 +47,7 @@ private:
/// Point when the cumulative counters were reset
Clock::time_point reset_point = Clock::now();
/// System time when the cumulative counters were reset
u64 reset_point_system_us = 0;
std::chrono::microseconds reset_point_system_us{0};
/// Cumulative duration (excluding v-sync/frame-limiting) of frames since last reset
Clock::duration accumulated_frametime = Clock::duration::zero();
@ -68,11 +68,11 @@ class FrameLimiter {
public:
using Clock = std::chrono::high_resolution_clock;
void DoFrameLimiting(u64 current_system_time_us);
void DoFrameLimiting(std::chrono::microseconds current_system_time_us);
private:
/// Emulated system time (in microseconds) at the last limiter invocation
u64 previous_system_time_us = 0;
std::chrono::microseconds previous_system_time_us{0};
/// Walltime at the last limiter invocation
Clock::time_point previous_walltime = Clock::now();