Public Member Functions
|TimeBlock (Timer &timer, bool start_timer=true)|
|Creates a new TimeBlock instance. |
|Destroys a TimeBlock instance. |
|Member function start starts the timer associated with the time block. |
|Member function lap sets the stop time of the timer associated with the time block. |
|Member function stop stops the timer associated with the time block. |
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.
|bool|| start_timer = |
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.
|timer||a Timer reference to the timer accumulate block run times.|
|start_timer||a bool value to have the timer started on construction.|