summaryrefslogtreecommitdiffstats
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2017-02-19 23:34:47 +0100
committerYuri Kunde Schlesner <yuriks@yuriks.net>2017-02-27 02:22:03 +0100
commitc75ae6c585f651a1b7c162c2e1ecccd22a1c587d (patch)
tree30d51f39c6b57244e1ede29820c3f5d98ca38451 /src/core/core.cpp
parentSynchronizedWrapper: Add Lock convenience method (diff)
downloadyuzu-c75ae6c585f651a1b7c162c2e1ecccd22a1c587d.tar
yuzu-c75ae6c585f651a1b7c162c2e1ecccd22a1c587d.tar.gz
yuzu-c75ae6c585f651a1b7c162c2e1ecccd22a1c587d.tar.bz2
yuzu-c75ae6c585f651a1b7c162c2e1ecccd22a1c587d.tar.lz
yuzu-c75ae6c585f651a1b7c162c2e1ecccd22a1c587d.tar.xz
yuzu-c75ae6c585f651a1b7c162c2e1ecccd22a1c587d.tar.zst
yuzu-c75ae6c585f651a1b7c162c2e1ecccd22a1c587d.zip
Diffstat (limited to '')
-rw-r--r--src/core/core.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index c9c9b7615..ca2c28ce4 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -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;
}