Public Member Functions | |
Timer () | |
Gather system information (clock ticks per second) upon creation. | |
Timer (const Timer &rhs) | |
Copy a timer. | |
~Timer () | |
const Timer & | operator= (const Timer &rhs) |
Make this timer a copy of the timer. | |
unsigned int | task (const std::string &name) |
Return the id associated to the unique task name provided if the association exists. | |
void | start () |
Clear any data in the timer (task names associations and results) and start the data gathering process (the timer is now running). | |
void | stop () |
Stop the data gathering process and compute results into a graph that can be exported in dot format (the timer is stopped). | |
void | clear () |
Clear any data in the timer (task names associations and results). | |
std::ostream & | print (std::ostream &o, timer::verbose_degree vd=timer::VERBOSE_NORMAL) const |
Write a summary of the results. | |
std::ostream & | export_dot (std::ostream &o, timer::verbose_degree vd=timer::VERBOSE_NORMAL, double ccr=1) const |
Export the task graph in dot format. | |
std::ostream & | dump (std::ostream &o) const |
Dump the task graph in XML format for post-processing. | |
void | push (const std::string &name) |
Start a sub-timer for a task using an unique string identifier (the task doesn't have to be declared beforehand). | |
void | push (const unsigned int i) |
The timer must be running. | |
void | pop (const std::string &task_name) |
Stop the named task. | |
void | pop (const unsigned int i) |
void | pop () |
Stop the current task's timer (the last task pushed). | |
bool | operator< (const Timer &rhs) const |
Comparison between two Timers. | |
Timer & | operator+= (const Timer &rhs) |
Accumulate another timer. | |
Timer | operator+ (const Timer &rhs) |
Sum two timers The two timers _must_ have the _exact same structure_ (ie: tasks defined and executed in the same order) and _must not_ be running. | |
Timer & | operator/= (unsigned rhs) |
Divide in place. | |
Timer | operator/ (unsigned rhs) const |
Divide. | |
Friends | |
class | timer::GraphWriter |
class | timer::VertexWriter |
class | timer::EdgeWriter |
Definition at line 312 of file timer.hh.
|
Copy a timer. It is not recommended to copy a running timer.
|
|
Make this timer a copy of the timer. It is not recommended to duplicate a running timer.
|
|
Return the id associated to the unique task name provided if the association exists. Otherwise, create the association and return its id. The timer has to be running.
|
|
Write a summary of the results. The timer must have been stopped.
Definition at line 86 of file timer.hxx. Referenced by misc::operator<<(). |
|
Export the task graph in dot format. The timer must have been stopped.
|
|
Dump the task graph in XML format for post-processing. All the information gathered is printed and include a large amount of redundancy. The Timer must be stopped. |
|
Start a sub-timer for a task using an unique string identifier (the task doesn't have to be declared beforehand). The timer must be running. Referenced by ScopedTimer::ScopedTimer(). |
|
Stop the named task. The timer must be running. Referenced by ScopedTimer::~ScopedTimer(). |
|
|
|
Stop the current task's timer (the last task pushed). The timer must be running. |
|
Comparison between two Timers. This operator enables the use of std::min and std::max. It checks only the total cpu time, so it's a strict weak ordering. Definition at line 59 of file timer.hxx. References Timer::graph_, Timer::is_running_, and precondition. |
|
Accumulate another timer. The two timers _must_ have the _exact same structure_ (ie: tasks defined and executed in the same order) and _must not_ be running. Alternatively, this timer can be empty (just initialized or cleared) Call counts are accumulated as well as measured times. Average values are updated. |
|
Sum two timers The two timers _must_ have the _exact same structure_ (ie: tasks defined and executed in the same order) and _must not_ be running. Call counts are accumulated as well as measured times. Average values are updated. |
|
Divide in place. Typically used to compute the mean of several timers. The timer _must not_ be running. Average values are updated. |
|
Divide. Typically used to compute the mean of several timers. The timer _must not_ be running. Average values are updated. |