diff options
| author | 2020-08-03 08:14:21 -0400 | |
|---|---|---|
| committer | 2020-08-03 12:33:40 -0400 | |
| commit | 570150bc86c104529a249ccd59f00a492011a9db (patch) | |
| tree | 3c5e1d0e2c83edabb1ccd23291f98e3276e2116e /src | |
| parent | perf_stats: Mark GetMeanFrametime() as const (diff) | |
| download | yuzu-570150bc86c104529a249ccd59f00a492011a9db.tar.gz yuzu-570150bc86c104529a249ccd59f00a492011a9db.tar.xz yuzu-570150bc86c104529a249ccd59f00a492011a9db.zip | |
perf_stats: Make use of designated initializers
Same behavior, but allows us to avoid a now-unnecessary zero
initialization.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/perf_stats.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index 36372c66f..b899ac884 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp | |||
| @@ -95,12 +95,13 @@ PerfStatsResults PerfStats::GetAndResetStats(microseconds current_system_time_us | |||
| 95 | 95 | ||
| 96 | const auto system_us_per_second = (current_system_time_us - reset_point_system_us) / interval; | 96 | const auto system_us_per_second = (current_system_time_us - reset_point_system_us) / interval; |
| 97 | 97 | ||
| 98 | PerfStatsResults results{}; | 98 | const PerfStatsResults results{ |
| 99 | results.system_fps = static_cast<double>(system_frames) / interval; | 99 | .system_fps = static_cast<double>(system_frames) / interval, |
| 100 | results.game_fps = static_cast<double>(game_frames) / interval; | 100 | .game_fps = static_cast<double>(game_frames) / interval, |
| 101 | results.frametime = duration_cast<DoubleSecs>(accumulated_frametime).count() / | 101 | .frametime = duration_cast<DoubleSecs>(accumulated_frametime).count() / |
| 102 | static_cast<double>(system_frames); | 102 | static_cast<double>(system_frames), |
| 103 | results.emulation_speed = system_us_per_second.count() / 1'000'000.0; | 103 | .emulation_speed = system_us_per_second.count() / 1'000'000.0, |
| 104 | }; | ||
| 104 | 105 | ||
| 105 | // Reset counters | 106 | // Reset counters |
| 106 | reset_point = now; | 107 | reset_point = now; |