Timer 1 minute

This commit is contained in:
DanielSvoboda 2024-10-09 02:21:34 -03:00
parent 5993a42908
commit af1e6114eb
2 changed files with 7 additions and 0 deletions

View File

@ -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);

View File

@ -5,6 +5,7 @@
#include <filesystem>
#include <thread>
#include <QTimer>
#include "common/singleton.h"
#include "core/linker.h"
@ -36,6 +37,7 @@ private:
Core::Linker* linker;
std::unique_ptr<Frontend::WindowSDL> window;
std::chrono::steady_clock::time_point start_time;
QTimer* timer;
};
} // namespace Core