19 #ifndef TRINITY_TIMER_H
20 #define TRINITY_TIMER_H
26 using namespace std::chrono;
28 static const system_clock::time_point ApplicationStartTime = system_clock::now();
30 return uint32(duration_cast<milliseconds>(system_clock::now() - ApplicationStartTime).count());
36 if (oldMSTime > newMSTime)
37 return (0xFFFFFFFF - oldMSTime) + newMSTime;
39 return newMSTime - oldMSTime;
bool Update(const uint32 diff)
Definition: Timer.h:177
void TUpdate(int32 diff)
Definition: Timer.h:193
int32 i_period
Definition: Timer.h:199
uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
Definition: Timer.h:33
IntervalTimer()
Definition: Timer.h:51
uint32 getMSTime()
Definition: Timer.h:24
time_t _current
Definition: Timer.h:97
TimeTracker(time_t expiry)
Definition: Timer.h:104
void Reset(time_t interval)
Definition: Timer.h:119
time_t i_expiryTime
Definition: Timer.h:131
bool Passed()
Definition: Timer.h:63
void Update(int32 diff)
Definition: Timer.h:143
void SetInterval(time_t interval)
Definition: Timer.h:79
void SetPeriodic(int32 period, int32 start_time)
Definition: Timer.h:186
int32 i_expireTime
Definition: Timer.h:200
int32_t int32
Definition: Define.h:146
void Update(time_t diff)
Definition: Timer.h:109
uint32_t uint32
Definition: Define.h:150
void Reset()
Definition: Timer.h:68
int32 i_expiryTime
Definition: Timer.h:165
void TReset(int32 diff, int32 period)
Definition: Timer.h:195
void Reset(uint32 interval)
Definition: Timer.h:153
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:42
void Update(time_t diff)
Definition: Timer.h:56
int32_t int32
Definition: g3dmath.h:167
time_t GetCurrent() const
Definition: Timer.h:89
bool Passed() const
Definition: Timer.h:114
uint32_t uint32
Definition: g3dmath.h:168
void SetCurrent(time_t current)
Definition: Timer.h:74
time_t GetExpiry() const
Definition: Timer.h:124
TimeTrackerSmall(uint32 expiry=0)
Definition: Timer.h:138
time_t _interval
Definition: Timer.h:96
time_t GetInterval() const
Definition: Timer.h:84
PeriodicTimer(int32 period, int32 start_time)
Definition: Timer.h:172
bool TPassed() const
Definition: Timer.h:194
int32 GetExpiry() const
Definition: Timer.h:158
bool Passed() const
Definition: Timer.h:148