stk::diag::TimeBlock Class Reference

Class TimeBlock is a time sentry for timing a statement block. More...

#include <Timer.hpp>

List of all members.

Public Member Functions

 TimeBlock (Timer &timer, bool start_timer=true)
 Creates a new TimeBlock instance.
 ~TimeBlock ()
 Destroys a TimeBlock instance.
void start ()
 Member function start starts the timer associated with the time block.
void lap ()
 Member function lap sets the stop time of the timer associated with the time block.
void stop ()
 Member function stop stops the timer associated with the time block.

Detailed Description

Class TimeBlock is a time sentry for timing a statement block.

The timer is generally started upon construction. But, the start is delayed if the second argument is false. In this case, manually start the timer by calling the start() function. This gives the safety of using a sentry, but does not force to awkwardness associated with local variables crossing the timed block.

Definition at line 485 of file Timer.hpp.


Constructor & Destructor Documentation

stk::diag::TimeBlock::TimeBlock ( Timer timer,
bool  start_timer = true 
) [inline, explicit]

Creates a new TimeBlock instance.

The newly created instance will start the timer if the start value is true, which is the default case. If the start value is false, the calling function is responsible for starting the timer at the appropriate time.

Parameters:
timer a Timer reference to the timer accumulate block run times.
start_timer a bool value to have the timer started on construction.

Definition at line 501 of file Timer.hpp.

stk::diag::TimeBlock::~TimeBlock (  )  [inline]

Destroys a TimeBlock instance.

Stops the timer if is has been started.

Definition at line 518 of file Timer.hpp.


The documentation for this class was generated from the following file:
Generated on Wed Apr 13 10:05:50 2011 for Sierra Toolkit by  doxygen 1.6.3