Add performance statistics to status bar

This commit is contained in:
Yuri Kunde Schlesner 2017-02-19 14:34:47 -08:00
parent 21f4f49c7a
commit c75ae6c585
11 changed files with 159 additions and 3 deletions

View file

@ -109,6 +109,11 @@ void System::PrepareReschedule() {
reschedule_pending = true;
}
PerfStats::Results System::GetAndResetPerfStats() {
auto perf_stats = this->perf_stats.Lock();
return perf_stats->GetAndResetStats(CoreTiming::GetGlobalTimeUs());
}
void System::Reschedule() {
if (!reschedule_pending) {
return;
@ -140,6 +145,10 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) {
LOG_DEBUG(Core, "Initialized OK");
// Reset counters and set time origin to current frame
GetAndResetPerfStats();
perf_stats.Lock()->BeginSystemFrame();
return ResultStatus::Success;
}