diff --git a/src/emulator.cpp b/src/emulator.cpp index c6535f87a..347931021 100644 --- a/src/emulator.cpp +++ b/src/emulator.cpp @@ -134,6 +134,11 @@ void Emulator::Run(const std::filesystem::path& file) { } #ifdef ENABLE_QT_GUI MemoryPatcher::g_game_serial = id; + + // Timer for 'Play Time' + timer = new QTimer(); + QObject::connect(timer, &QTimer::timeout, [this, id]() { UpdatePlayTime(id); }); + timer->start(60000); // 60000 ms = 1 minute #endif title = param_sfo->GetString("TITLE").value_or("Unknown title"); LOG_INFO(Loader, "Game id: {} Title: {}", id, title); diff --git a/src/emulator.h b/src/emulator.h index dc2959af4..83f8cd99d 100644 --- a/src/emulator.h +++ b/src/emulator.h @@ -5,6 +5,7 @@ #include #include +#include #include "common/singleton.h" #include "core/linker.h" @@ -36,6 +37,7 @@ private: Core::Linker* linker; std::unique_ptr window; std::chrono::steady_clock::time_point start_time; + QTimer* timer; }; } // namespace Core