diff options
Diffstat (limited to 'src/core/perf_stats.cpp')
| -rw-r--r-- | src/core/perf_stats.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index c716a462b..4afd6c8a3 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp | |||
| @@ -18,13 +18,13 @@ using std::chrono::microseconds; | |||
| 18 | namespace Core { | 18 | namespace Core { |
| 19 | 19 | ||
| 20 | void PerfStats::BeginSystemFrame() { | 20 | void PerfStats::BeginSystemFrame() { |
| 21 | std::lock_guard<std::mutex> lock(object_mutex); | 21 | std::lock_guard lock{object_mutex}; |
| 22 | 22 | ||
| 23 | frame_begin = Clock::now(); | 23 | frame_begin = Clock::now(); |
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | void PerfStats::EndSystemFrame() { | 26 | void PerfStats::EndSystemFrame() { |
| 27 | std::lock_guard<std::mutex> lock(object_mutex); | 27 | std::lock_guard lock{object_mutex}; |
| 28 | 28 | ||
| 29 | auto frame_end = Clock::now(); | 29 | auto frame_end = Clock::now(); |
| 30 | accumulated_frametime += frame_end - frame_begin; | 30 | accumulated_frametime += frame_end - frame_begin; |
| @@ -35,13 +35,13 @@ void PerfStats::EndSystemFrame() { | |||
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | void PerfStats::EndGameFrame() { | 37 | void PerfStats::EndGameFrame() { |
| 38 | std::lock_guard<std::mutex> lock(object_mutex); | 38 | std::lock_guard lock{object_mutex}; |
| 39 | 39 | ||
| 40 | game_frames += 1; | 40 | game_frames += 1; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | PerfStatsResults PerfStats::GetAndResetStats(microseconds current_system_time_us) { | 43 | PerfStatsResults PerfStats::GetAndResetStats(microseconds current_system_time_us) { |
| 44 | std::lock_guard<std::mutex> lock(object_mutex); | 44 | std::lock_guard lock{object_mutex}; |
| 45 | 45 | ||
| 46 | const auto now = Clock::now(); | 46 | const auto now = Clock::now(); |
| 47 | // Walltime elapsed since stats were reset | 47 | // Walltime elapsed since stats were reset |
| @@ -67,7 +67,7 @@ PerfStatsResults PerfStats::GetAndResetStats(microseconds current_system_time_us | |||
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | double PerfStats::GetLastFrameTimeScale() { | 69 | double PerfStats::GetLastFrameTimeScale() { |
| 70 | std::lock_guard<std::mutex> lock(object_mutex); | 70 | std::lock_guard lock{object_mutex}; |
| 71 | 71 | ||
| 72 | constexpr double FRAME_LENGTH = 1.0 / 60; | 72 | constexpr double FRAME_LENGTH = 1.0 / 60; |
| 73 | return duration_cast<DoubleSecs>(previous_frame_length).count() / FRAME_LENGTH; | 73 | return duration_cast<DoubleSecs>(previous_frame_length).count() / FRAME_LENGTH; |