diff options
| author | 2017-02-20 13:56:58 -0800 | |
|---|---|---|
| committer | 2017-02-26 17:22:03 -0800 | |
| commit | b285c2a4ed29a126b5bcfe46e2784bd1870bdf82 (patch) | |
| tree | a671ac87427fb63a64f51be260928cb39b8d3737 /src/core/perf_stats.h | |
| parent | Qt: Add tooltips to status bar displays (diff) | |
| download | yuzu-b285c2a4ed29a126b5bcfe46e2784bd1870bdf82.tar.gz yuzu-b285c2a4ed29a126b5bcfe46e2784bd1870bdf82.tar.xz yuzu-b285c2a4ed29a126b5bcfe46e2784bd1870bdf82.zip | |
Core: Make PerfStats internally locked
More ergonomic to use and will be required for upcoming changes.
Diffstat (limited to 'src/core/perf_stats.h')
| -rw-r--r-- | src/core/perf_stats.h | 7 |
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 | ||
| 10 | namespace Core { | 11 | namespace 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 | */ | ||
| 12 | class PerfStats { | 17 | class PerfStats { |
| 13 | public: | 18 | public: |
| 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 | ||
| 39 | private: | 44 | private: |
| 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; |