Sierra Toolkit Version of the Day
stk::diag::TimeBlock Class Reference

#include <Timer.hpp>

Collaboration diagram for stk::diag::TimeBlock:

List of all members.

Public Member Functions

 TimeBlock (Timer &timer, bool start_timer=true)
 ~TimeBlock ()
void start ()
void lap ()
void stop ()

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.

timera Timer reference to the timer accumulate block run times.
start_timera 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.

Member Function Documentation

void stk::diag::TimeBlock::start ( ) [inline]

Member function start starts the timer associated with the time block.

Definition at line 531 of file Timer.hpp.

void stk::diag::TimeBlock::lap ( ) [inline]

Member function lap sets the stop time of the timer associated with the time block.

Definition at line 541 of file Timer.hpp.

void stk::diag::TimeBlock::stop ( ) [inline]

Member function stop stops the timer associated with the time block.

Definition at line 549 of file Timer.hpp.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends