Class DurationMeasure

java.lang.Object
All Implemented Interfaces:
Serializable, Measure<Long>, PullMeasure<Long>, DescribedEntity

public class DurationMeasure extends SimplePullMeasure<Long>
This measure allows to have a simple way to compute the time spent in doing something. For instance, an algorithm can compute the time spent to run. In such a case, the algorithm would call start() at the beginning of the running and stop() at the end. Additional calls to these two methods can also be made during the running to exclude specific parts from the counting. At any time during (and after) the running, the get() method can be used to know how much time have been spent so far. If the algorithm is rerun, it will restart and the additional time will sum up to the time already spent before, but it can be avoided by resetting the measure with reset().
Author:
Matthieu Vergne
See Also: