mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 03:16:54 +02:00
refactor(subsystems&ime): RAII lifecycle
This commit is contained in:
@@ -2,21 +2,12 @@
|
||||
|
||||
#include "common/abi.h"
|
||||
#include "common/dateTime.h"
|
||||
#include "common/subsystems.h"
|
||||
#include "loader/timer.h"
|
||||
|
||||
namespace Loader::Timer {
|
||||
|
||||
static Common::Timer g_timer;
|
||||
|
||||
KYTY_SUBSYSTEM_INIT(Timer) {
|
||||
Start();
|
||||
}
|
||||
|
||||
KYTY_SUBSYSTEM_UNEXPECTED_SHUTDOWN(Timer) {}
|
||||
|
||||
KYTY_SUBSYSTEM_DESTROY(Timer) {}
|
||||
|
||||
void Start() {
|
||||
g_timer.Start();
|
||||
}
|
||||
|
||||
+5
-4
@@ -4,18 +4,19 @@
|
||||
#include "common/abi.h"
|
||||
#include "common/common.h"
|
||||
#include "common/dateTime.h"
|
||||
#include "common/subsystems.h"
|
||||
|
||||
namespace Loader::Timer {
|
||||
|
||||
KYTY_SUBSYSTEM_DEFINE(Timer);
|
||||
|
||||
void Start();
|
||||
double GetTimeMs();
|
||||
Common::Time GetTime();
|
||||
uint64_t GetCounter();
|
||||
uint64_t GetFrequency();
|
||||
|
||||
struct Lifecycle {
|
||||
static constexpr const char* name = "Timer";
|
||||
static constexpr auto initialize = Loader::Timer::Start;
|
||||
};
|
||||
|
||||
} // namespace Loader::Timer
|
||||
|
||||
#endif /* EMULATOR_INCLUDE_EMULATOR_LOADER_TIMER_H_ */
|
||||
|
||||
Reference in New Issue
Block a user