A named time period measurement with accumulation. More...
#include <common_time_period.h>
Public Member Functions | |
| TimePeriod (const char *name=NULL) | |
| Constructs internal structures and starts measuring. | |
| const TimePeriod & | reset () |
| Resets accumulated time. | |
| const TimePeriod & | tick_reset () |
| Starts a new period and resets accumulated time. | |
| const TimePeriod & | tick (TimerPeriodTickType type=H2D_ACCUMULATE) |
| Starts/ends a new period. | |
| const std::string & | name () const |
| Returns a name of the time period if any. | |
| double | accumulated () const |
| Returns accumulated time (in seconds). | |
| std::string | accumulated_str () const |
| Returns accumulated time in human readable form. | |
| double | last () const |
| Returns last measured period (in seconds). | |
| std::string | last_str () const |
| Returns last measured period in human readable form. | |
Friends | |
| H2D_API std::ofstream & | operator<< (std::ofstream &stream, const TimePeriod &period) |
A named time period measurement with accumulation.
An instance of the timer should not be used across threads. The class is not thread-safe.
| TimePeriod::TimePeriod | ( | const char * | name = NULL |
) |
Constructs internal structures and starts measuring.
| double TimePeriod::accumulated | ( | ) | const [inline] |
Returns accumulated time (in seconds).
| std::string TimePeriod::accumulated_str | ( | ) | const [inline] |
Returns accumulated time in human readable form.
| double TimePeriod::last | ( | ) | const [inline] |
Returns last measured period (in seconds).
| std::string TimePeriod::last_str | ( | ) | const [inline] |
Returns last measured period in human readable form.
| const std::string& TimePeriod::name | ( | ) | const [inline] |
Returns a name of the time period if any.
| const TimePeriod & TimePeriod::reset | ( | ) |
Resets accumulated time.
| const TimePeriod & TimePeriod::tick | ( | TimerPeriodTickType | type = H2D_ACCUMULATE |
) |
Starts/ends a new period.
| const TimePeriod & TimePeriod::tick_reset | ( | ) |
Starts a new period and resets accumulated time.
| H2D_API std::ofstream& operator<< | ( | std::ofstream & | stream, | |
| const TimePeriod & | period | |||
| ) | [friend] |
1.6.3