HDK
|
Simple timer for basic profiling. More...
#include <CpuTimer.h>
Public Member Functions | |
CpuTimer (std::ostream &os=std::cerr) | |
Initiate timer. More... | |
CpuTimer (const std::string &msg, std::ostream &os=std::cerr) | |
Prints message and start timer. More... | |
void | start () |
Start timer. More... | |
void | start (const std::string &msg) |
Print message and start timer. More... | |
int64_t | microseconds () const |
Return Time difference in microseconds since construction or start was called. More... | |
double | milliseconds () const |
Return Time difference in milliseconds since construction or start was called. More... | |
double | seconds () const |
Return Time difference in seconds since construction or start was called. More... | |
std::string | time () const |
double | stop () const |
Returns and prints time in milliseconds since construction or start was called. More... | |
double | stop (const std::string &msg) const |
Returns and prints time in milliseconds since construction or start was called. More... | |
double | restart () |
Re-start timer. More... | |
double | restart (const std::string &msg) |
Stop previous timer, print message and re-start timer. More... | |
Simple timer for basic profiling.
or to time multiple blocks of code
or to measure speedup between multiple runs
or to measure multiple blocks of code with deferred output
Definition at line 66 of file CpuTimer.h.
|
inline |
Initiate timer.
Definition at line 70 of file CpuTimer.h.
|
inline |
Prints message and start timer.
Definition at line 75 of file CpuTimer.h.
|
inline |
Return Time difference in microseconds since construction or start was called.
Definition at line 94 of file CpuTimer.h.
|
inline |
Return Time difference in milliseconds since construction or start was called.
Definition at line 102 of file CpuTimer.h.
|
inline |
Re-start timer.
Definition at line 150 of file CpuTimer.h.
|
inline |
Stop previous timer, print message and re-start timer.
Definition at line 161 of file CpuTimer.h.
|
inline |
Return Time difference in seconds since construction or start was called.
Definition at line 111 of file CpuTimer.h.
|
inline |
Start timer.
Definition at line 80 of file CpuTimer.h.
|
inline |
Print message and start timer.
Definition at line 85 of file CpuTimer.h.
|
inline |
Returns and prints time in milliseconds since construction or start was called.
Definition at line 128 of file CpuTimer.h.
|
inline |
Returns and prints time in milliseconds since construction or start was called.
Definition at line 138 of file CpuTimer.h.
|
inline |
Definition at line 117 of file CpuTimer.h.