Class CounterTiming
java.lang.Object
org.pipservices3.components.count.CounterTiming
Callback object returned by
ICounters.beginTiming(String) to end timing
of execution block and update the associated counter.
### Example ###
CounterTiming timing = counters.beginTiming("mymethod.exec_time");
try {
...
} finally {
timing.endTiming();
}
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of the timing callback object.CounterTiming(String counter, ICounterTimingCallback callback) Creates a new instance of the timing callback object. -
Method Summary
Modifier and TypeMethodDescriptionvoidEnds timing of an execution block, calculates elapsed time and updates the associated counter.
-
Constructor Details
-
CounterTiming
public CounterTiming()Creates a new instance of the timing callback object. -
CounterTiming
Creates a new instance of the timing callback object.- Parameters:
counter- an associated counter namecallback- a callback that shall be called when endTiming is called.
-
-
Method Details
-
endTiming
public void endTiming()Ends timing of an execution block, calculates elapsed time and updates the associated counter.
-