TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Timer.h File Reference
#include <chrono>
+ Include dependency graph for Timer.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  IntervalTimer
 
struct  TimeTracker
 
struct  TimeTrackerSmall
 
struct  PeriodicTimer
 

Functions

uint32 getMSTime ()
 
uint32 getMSTimeDiff (uint32 oldMSTime, uint32 newMSTime)
 
uint32 GetMSTimeDiffToNow (uint32 oldMSTime)
 

Function Documentation

uint32 getMSTime ( )
inline
25 {
26  using namespace std::chrono;
27 
28  static const system_clock::time_point ApplicationStartTime = system_clock::now();
29 
30  return uint32(duration_cast<milliseconds>(system_clock::now() - ApplicationStartTime).count());
31 }
uint32_t uint32
Definition: g3dmath.h:168
uint32 getMSTimeDiff ( uint32  oldMSTime,
uint32  newMSTime 
)
inline
34 {
35  // getMSTime() have limited data range and this is case when it overflow in this tick
36  if (oldMSTime > newMSTime)
37  return (0xFFFFFFFF - oldMSTime) + newMSTime;
38  else
39  return newMSTime - oldMSTime;
40 }

+ Here is the caller graph for this function:

uint32 GetMSTimeDiffToNow ( uint32  oldMSTime)
inline
43 {
44  return getMSTimeDiff(oldMSTime, getMSTime());
45 }
uint32 getMSTimeDiff(uint32 oldMSTime, uint32 newMSTime)
Definition: Timer.h:33
uint32 getMSTime()
Definition: Timer.h:24

+ Here is the call graph for this function: