durationFactory Method

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

Syntax
Duration elapsedTime(Accumulator accumulatorObject);
Parameters
accumulatorObject - [in] Required reference to an Accumulator object, which accumulates the recorded durations of the associated Event. A different Accumulator may be specified for the Duration object by using the start method.
Example
Listener listener = new Listener("sampleApp", "4.0");
Container store = listener.lookupContainer("storeName");
Event creations = store.lookupEvent(PCHeventClass.RPC, "document creations");
Accumulator numCreations = creations.lookupAccumulator("number of creations");
Duration elapsedTime = listener.durationFactory(numCreations);
...
See Also
Accumulator Class
Listener Class
start Method
stop Method