durationFactory Member Function

Enables the Listener to create a Duration object on the stack. The Listener does not keep pointers to the objects returned by this function, therefore, Duration objects created in this manner should be deleted when they will no longer be used. Note that it is also possible to create Duration objects using the new operator.

Duration Accumulators should be named "duration" because the Manager Dashboard looks for this Accumulator name.

Syntax
Duration elapsedTime(Accumulator *AccumulatorObject);
Parameters
AccumulatorObject - [in] Required pointer to an Accumulator object, which accumulates the time recorded by this Duration object. A different Accumulator may be specified for the Duration object using the start function.
Example
Listener *listener = new Listener("sampleApp", "4.0", NULL, false);
Container *store = listener->lookupContainer("storeName");
Event *creations = store->lookupEvent(PCHeventClass.RPC, "document creations");
Accumulator *numCreations = creations->lookupAccumulator("number of creations");
Duration duration = listener->durationFactory(numCreations);
...
See Also
Accumulator Class
Listener Class
start Member Function
stop Member Function