stop Member Function

After the recording interval for a Duration object completes, stop is called to calculate the time that passed since the start member function was run. The elapsed time is then recorded (nanoseconds) to the current Accumulator and returned.

Syntax

unsigned __int64 stop([optional] bool incrementCounter);

Parameters

incrementCounter
[in] Optional Boolean value (default is false), which indicates whether to increment the associated Event object counter. When set to true, the second parameter of the recordValue member function of the associated Accumulator is also set to true. This causes the counter of the Event that is associated with the Accumulator to automatically be incremented after the elapsed time is recorded.

Example

Listener *listener = new Listener("sampleApp", "4.0", NULL, false);
Duration *readTime = listener->durationFactory("duration of read");
readTime->start(NULL);
...
unsigned __int64 totalRead = readTime->stop(true);
...

See Also