Timer Class Reference

List of all members.

Public Member Functions

 Timer ()
 Gather system information (clock ticks per second) upon creation.
 Timer (const Timer &rhs)
 Copy a timer.
 ~Timer ()
const Timeroperator= (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)
 
See also:
pop (), pop (const std::string name) The timer must be running.

void pop ()
 Stop the current task's timer (the last task pushed).
bool operator< (const Timer &rhs) const
 Comparison between two Timers.
Timeroperator+= (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.
Timeroperator/= (unsigned rhs)
 Divide in place.
Timer operator/ (unsigned rhs) const
 Divide.

Friends

class timer::GraphWriter
class timer::VertexWriter
class timer::EdgeWriter

Detailed Description

Definition at line 312 of file timer.hh.


Constructor & Destructor Documentation

Timer ( const Timer rhs  ) 

Copy a timer.

It is not recommended to copy a running timer.

Parameters:
rhs the timer to be duplicated.


Member Function Documentation

const Timer& operator= ( const Timer rhs  ) 

Make this timer a copy of the timer.

It is not recommended to duplicate a running timer.

Parameters:
rhs the timer to be duplicated.

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.

Parameters:
name the task name.

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 [inline]

Write a summary of the results.

The timer must have been stopped.

Parameters:
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]

Export the task graph in dot format.

The timer must have been stopped.

Parameters:
o the output stream.
vd determines the amount of information in the output graph.
ccr adjusts how much the task self charge affects the node color

Definition at line 96 of file timer.hxx.

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  ) 

Stop the named task.

The timer must be running.

Referenced by ScopedTimer::~ScopedTimer().

void pop ( const unsigned int  i  ) 

See also:
pop (), pop (const std::string name) The timer must be running.

void pop (  ) 

Stop the current task's timer (the last task pushed).

The timer must be running.

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.

Timer& operator+= ( const Timer rhs  ) 

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.

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.

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.


Generated on Sun Jul 29 19:48:37 2007 for Vaucanson by  doxygen 1.5.2