MIRA
|
Class that can be used as a stop watch to measure execution time of operations. More...
#include <error/LogTimer.h>
Public Member Functions | |
LogTimer (SeverityLevel level, const char *name, const Time &time, const char *file, int line, const char *function, ThreadID threadID, const std::string &caption) | |
Constructor taking details for a log entry. More... | |
~LogTimer () | |
Destructor. More... | |
Duration | peek () const |
Use this function to trace the time consumed since the start of this timer. More... | |
void | end () |
This function can be called to end tracing at a defined point before destruction. More... | |
Class that can be used as a stop watch to measure execution time of operations.
Never use this class directly use the R_LOGTIMER macro instead. An instance of this class will automatically write a log entry on construction and an entry on destruction counting the time between both. e.g.
will produce LOGENTRY MyTimer[I watch you] started. LOGENTRY MyTimer[I watch you] ended taking 00:00:00.531772
LogTimer | ( | SeverityLevel | level, |
const char * | name, | ||
const Time & | time, | ||
const char * | file, | ||
int | line, | ||
const char * | function, | ||
ThreadID | threadID, | ||
const std::string & | caption | ||
) |
Constructor taking details for a log entry.
~LogTimer | ( | ) |
Destructor.
Duration peek | ( | ) | const |
Use this function to trace the time consumed since the start of this timer.
void end | ( | ) |
This function can be called to end tracing at a defined point before destruction.
If this function is called no log is created upon destruction.