ClTimer
is a tool class to help with timing.
It includes some useful string output for timers.
Formated string output for timer data | |
std::string | getDescription (size_t padWidth=35) const |
Returns the description from the constructor (used by follwing functions). | |
void | setDescription (const std::string &crstrDesc) |
Returns the description from the constructor (used by follwing functions). | |
std::string | timeString () const |
Returns <DESCRIPTION>: <accumulatedTime> seconds. | |
std::string | relativeThroughputString (size_t items, const std::string &itemsname="") const |
Returns <DESCRIPTION>: <items/accumulatedTime> <itemname> / second. | |
std::string | percentString (double relative_to_seconds) const |
Returns <DESCRIPTION>: <accumulatedTime/relative_to_seconds>%. | |
std::string | percentString (const Timer &relative_to_timer) const |
Returns <DESCRIPTION>: <accumulatedTime/relative_to_seconds>%. | |
std::string | timeAndPercentString (double relative_to_seconds) const |
Returns absolute (timeString) and relative (percentString) as one string. | |
std::string | timeAndPercentString (const Timer &relative_to_timer) const |
Returns absolute (timeString) and relative (percentString) as one string. | |
std::string | timeAndPercentAndThroughputString (double relative_to_seconds, size_t relative_to_items, const std::string &itemsname="") const |
Returns combination of timeAndPercentString plus relativeThroughputString . | |
static std::string | timeString (double dTime) |
Public Member Functions | |
Timer (const std::string &clstrDescription="") | |
Constructor. | |
void | start (void) |
void | stop (void) |
void | reset (void) |
double | getAccumulatedTime (void) const |
Retrieve the accumulated time To avoid division by zero errors we never return zero but FLT_MIN instead. | |
double | getTimeSoFar () const |
Returns timed time up to now. | |
Operators to combine timers | |
Timer | operator+ (const Timer &crclOther) const |
Addition of timers. | |
Timer | operator- (const Timer &crclOther) const |
Subtraction of timers. |
uima::Timer::Timer | ( | const std::string & | clstrDescription = "" |
) | [inline] |
Constructor.
void uima::Timer::start | ( | void | ) | [inline] |
void uima::Timer::stop | ( | void | ) | [inline] |
void uima::Timer::reset | ( | void | ) | [inline] |
double uima::Timer::getAccumulatedTime | ( | void | ) | const [inline] |
Retrieve the accumulated time To avoid division by zero errors we never return zero but FLT_MIN instead.
double uima::Timer::getTimeSoFar | ( | ) | const [inline] |
Returns timed time up to now.
std::string uima::Timer::getDescription | ( | size_t | padWidth = 35 |
) | const |
Returns the description from the constructor (used by follwing functions).
void uima::Timer::setDescription | ( | const std::string & | crstrDesc | ) | [inline] |
Returns the description from the constructor (used by follwing functions).
Referenced by operator+(), and operator-().
std::string uima::Timer::timeString | ( | ) | const |
Returns <DESCRIPTION>: <accumulatedTime> seconds.
std::string uima::Timer::relativeThroughputString | ( | size_t | items, | |
const std::string & | itemsname = "" | |||
) | const |
Returns <DESCRIPTION>: <items/accumulatedTime> <itemname> / second.
std::string uima::Timer::percentString | ( | double | relative_to_seconds | ) | const |
Returns <DESCRIPTION>: <accumulatedTime/relative_to_seconds>%.
std::string uima::Timer::percentString | ( | const Timer & | relative_to_timer | ) | const |
Returns <DESCRIPTION>: <accumulatedTime/relative_to_seconds>%.
std::string uima::Timer::timeAndPercentString | ( | double | relative_to_seconds | ) | const |
Returns absolute (timeString) and relative (percentString) as one string.
std::string uima::Timer::timeAndPercentString | ( | const Timer & | relative_to_timer | ) | const |
Returns absolute (timeString) and relative (percentString) as one string.
std::string uima::Timer::timeAndPercentAndThroughputString | ( | double | relative_to_seconds, | |
size_t | relative_to_items, | |||
const std::string & | itemsname = "" | |||
) | const |
Returns combination of timeAndPercentString
plus relativeThroughputString
.
static std::string uima::Timer::timeString | ( | double | dTime | ) | [static] |