12 #ifndef __TIMING_HEADER__
13 #define __TIMING_HEADER__
35 std::chrono::steady_clock::time_point timeStamp;
38 #if defined(_CONSOLE) || defined(_WIN32) || defined(_WIN64)
41 inline void Start() { timeStamp = std::chrono::steady_clock::now(); }
44 inline double Stop()
const
46 auto elapsedTime = std::chrono::steady_clock::now() - timeStamp;
47 return std::chrono::duration<double, std::milli>(elapsedTime).count();
51 __inline__
void Start() { timeStamp = std::chrono::steady_clock::now(); }
54 __inline__
double Stop()
const
56 auto elapsedTime = std::chrono::steady_clock::now() - timeStamp;
57 return std::chrono::duration<double, std::milli>(elapsedTime).count();
61 void StopInfo(
const std::string& info, std::ostream& out = std::cout)
const;
const double CLOCK_USE_MIN
Show clock time in minutes.
unsigned long long uint64
Unsigned long long int.
const double CLOCK_USE_SEC
Show clock time in seconds.
Get elapsed wall-time in millisecond.
__inline__ double Stop() const
Stop the timer and return duration from start() in ms.
__inline__ void Start()
Start the timer.
void StopInfo(const std::string &info, std::ostream &out=std::cout) const
Stop the timer and print out duration time.