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.
unsigned int task | ( | const std::string & | name | ) |
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.
name | the task name. |
void start | ( | ) |
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 [inline] |
Write a summary of the results.
The timer must have been stopped.
o | the output stream. | |
vd | determines the amount of information printed |
Definition at line 86 of file timer.hxx.
Referenced by misc::operator<<().
std::ostream & export_dot | ( | std::ostream & | o, | |
timer::verbose_degree | vd = timer::VERBOSE_NORMAL , |
|||
double | ccr = 1 | |||
) | const [inline] |
std::ostream& dump | ( | std::ostream & | o | ) | const |
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.
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).
The timer must be running.
Referenced by ScopedTimer::ScopedTimer().
void pop | ( | const std::string & | task_name | ) |
void pop | ( | const unsigned int | i | ) |
bool operator< | ( | const Timer & | rhs | ) | const [inline] |
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.
Timer& operator/= | ( | unsigned | rhs | ) |
Divide in place.
Typically used to compute the mean of several timers. The timer _must not_ be running. Average values are updated.
Timer operator/ | ( | unsigned | rhs | ) | const |
Divide.
Typically used to compute the mean of several timers. The timer _must not_ be running. Average values are updated.