summaryrefslogtreecommitdiff
path: root/src/core/perf_stats.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/perf_stats.h')
-rw-r--r--src/core/perf_stats.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/perf_stats.h b/src/core/perf_stats.h
index 8a03c511a..4098fc1f2 100644
--- a/src/core/perf_stats.h
+++ b/src/core/perf_stats.h
@@ -5,10 +5,15 @@
5#pragma once 5#pragma once
6 6
7#include <chrono> 7#include <chrono>
8#include <mutex>
8#include "common/common_types.h" 9#include "common/common_types.h"
9 10
10namespace Core { 11namespace Core {
11 12
13/**
14 * Class to manage and query performance/timing statistics. All public functions of this class are
15 * thread-safe unless stated otherwise.
16 */
12class PerfStats { 17class PerfStats {
13public: 18public:
14 using Clock = std::chrono::high_resolution_clock; 19 using Clock = std::chrono::high_resolution_clock;
@@ -37,6 +42,8 @@ public:
37 double GetLastFrameTimeScale(); 42 double GetLastFrameTimeScale();
38 43
39private: 44private:
45 std::mutex object_mutex;
46
40 Clock::time_point reset_point = Clock::now(); 47 Clock::time_point reset_point = Clock::now();
41 48
42 Clock::time_point frame_begin = reset_point; 49 Clock::time_point frame_begin = reset_point;