From b285c2a4ed29a126b5bcfe46e2784bd1870bdf82 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Mon, 20 Feb 2017 13:56:58 -0800 Subject: Core: Make PerfStats internally locked More ergonomic to use and will be required for upcoming changes. --- src/core/perf_stats.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/core/perf_stats.h') 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 @@ #pragma once #include +#include #include "common/common_types.h" namespace Core { +/** + * Class to manage and query performance/timing statistics. All public functions of this class are + * thread-safe unless stated otherwise. + */ class PerfStats { public: using Clock = std::chrono::high_resolution_clock; @@ -37,6 +42,8 @@ public: double GetLastFrameTimeScale(); private: + std::mutex object_mutex; + Clock::time_point reset_point = Clock::now(); Clock::time_point frame_begin = reset_point; -- cgit v1.2.3