19#include <libretro-common/features/features_cpu.h>
20#include <libretro-common/libretro.h>
48 return simulated >= 0 ? simulated : cpu_features_get_time_usec();
57 return cpu_features_get_time_usec();
85 return std::time(
nullptr);
108 localtime_s(&result, &time);
110 localtime_r(&time, &result);
194 void stop(
bool finished);
196 bool running =
false;
virtual void onReset()
Definition time.hpp:231
virtual void onRewind()
Definition time.hpp:226
static std::vector< Ticking * > runningTickings
Definition time.hpp:169
virtual void onStop()
Definition time.hpp:191
virtual bool onUpdate(Time delta)=0
void setEndCallback(TickingEndCallback endCallback)
void setTickCallback(TickingTickCallback tickCallback)
virtual void onStart()
Definition time.hpp:185
static void updateTickings()
std::atomic< Time > simulatedWallTimeSetAt
Definition time.hpp:38
std::atomic< int64_t > simulatedWallTime
Definition time.hpp:37
std::atomic< Time > simulatedTimeUsec
Definition time.hpp:36
Definition actions.hpp:25
Time getCPUTimeUsec()
Definition time.hpp:45
bool isTimeSimulated()
Definition time.hpp:71
void setSimulatedWallTime(int64_t seconds)
Definition time.hpp:94
std::time_t getWallTime()
Definition time.hpp:81
void setSimulatedTimeUsec(Time usec)
Definition time.hpp:66
std::function< void()> TickingGenericCallback
Definition time.hpp:115
retro_time_t Time
Definition time.hpp:31
std::function< void(bool)> TickingEndCallback
Definition time.hpp:117
TickingGenericCallback TickingTickCallback
Definition time.hpp:118
std::tm localTime(std::time_t time)
Definition time.hpp:104
Time getRealTimeUsec()
Definition time.hpp:55