Package com.ocient.util
Class SimpleMillisCounter
java.lang.Object
com.ocient.util.SimpleMillisCounter
- All Implemented Interfaces:
DurationCounter
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
SimpleMillisCounter
public SimpleMillisCounter()
-
-
Method Details
-
start
public void start()Description copied from interface:DurationCounterStarts the time measurement. This method should be called when you want to begin measuring the duration.- Specified by:
startin interfaceDurationCounter
-
stop
public void stop()Description copied from interface:DurationCounterEnds the time measurement. This method should be called when you want to stop measuring the duration.- Specified by:
stopin interfaceDurationCounter
-
getAndReset
public long getAndReset()Description copied from interface:DurationCounterRetrieves the elapsed time duration between the "start" and "end" points, and then resets the internal state of the counter for subsequent measurements.- Specified by:
getAndResetin interfaceDurationCounter- Returns:
- The elapsed time duration in millis (possibly 0). -1 if called when counter has started but not stopped.
-