The class provides an accumulator for the system, user, and wall times of the current process. A stopwatch can be in either the STOPPED (initial) state or the RUNNING state. It potentially tracks three values: the accumulated system time, the accumulated user time, and the accumulated wall time (all in seconds and all initially set to zero). Whether or not system and user times are accumulated is conditional on how the stopwatch is started (see the start method). While in the RUNNING state, a stopwatch accumulates the above values and it retains the values if put into the STOPPED state (unless reset is called). The accumulated times can be accessed at any time and in either state (RUNNING or STOPPED).
Synopsis
Declared in <bsls_stopwatch.h>
class Stopwatch;
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this stopwatch. Note that this method's definition is compiler generated. |
Return the total (instantaneous and quiescent) elapsed system time (in seconds) accumulated by this stopwatch, or 0 if the collection of CPU times is disabled. |
|
Load into the specified |
|
Return the total (instantaneous and quiescent) elapsed user time (in seconds) accumulated by this stopwatch, or 0 if the collection of CPU times is disabled. |
|
Return the total (instantaneous and quiescent) elapsed wall time (in seconds) accumulated by this stopwatch. |
|
Return the total (instantaneous and quiescent) elapsed wall time (in seconds) accumulated by this stopwatch. Note that this method is equivalent to |
|
Return |
|
Place this stopwatch in the STOPPED state, unconditionally stopping the accumulation of elapsed times, and set the quiescent elapsed times to 0.0. |
|
Place this stopwatch in the RUNNING state and begin accumulating elapsed times if this object was in the STOPPED state. Optionally specify a |
|
Place this stopwatch in the STOPPED state, unconditionally stopping the accumulation of elapsed times. Note that the quiescent accumulated elapsed times are available while in the STOPPED state. |
Static Data Members
Name |
Description |
|
For readability/ease of understanding of code that calls the |
Collect wall time only (not CPU time). |
Created with MrDocs