Duration Class
Duration objects may be created in one of the following ways:
- Via the constructor for the class.
- Via the
new
operator.
- By calling the durationFactory member
function of the Listener object. However, the
Listener does not keep a pointer to the objects returned by the durationFactory member
function.
Therefore, objects created in this manner should be deleted when they will
no longer be used.
For more information about creating and using Durations, see the topics in
the section Measuring Elapsed Time
with Durations.
- Constructor
- durationFactory - Creates a Duration
object at the top-level of the Listener.
- Member Functions
- start - Indicates the beginning of the time
interval that is to be measured (accumulated).
- stop - Once the recording interval has completed,
stop is called to calculate the time that has passed since start was called.
The elapsed time (nanoseconds) is recorded to the current Accumulator and
returned by this function. In addition, stop may be called in a manner which
causes the value of the associated Event counter to be incremented as well.
- See Also
- Accumulator Class
- Listener Class