Class SimpleMillisCounter

java.lang.Object
com.ocient.util.SimpleMillisCounter
All Implemented Interfaces:
DurationCounter

public class SimpleMillisCounter extends Object implements DurationCounter
  • Constructor Details

    • SimpleMillisCounter

      public SimpleMillisCounter()
  • Method Details

    • start

      public void start()
      Description copied from interface: DurationCounter
      Starts the time measurement. This method should be called when you want to begin measuring the duration.
      Specified by:
      start in interface DurationCounter
    • stop

      public void stop()
      Description copied from interface: DurationCounter
      Ends the time measurement. This method should be called when you want to stop measuring the duration.
      Specified by:
      stop in interface DurationCounter
    • getAndReset

      public long getAndReset()
      Description copied from interface: DurationCounter
      Retrieves the elapsed time duration between the "start" and "end" points, and then resets the internal state of the counter for subsequent measurements.
      Specified by:
      getAndReset in interface DurationCounter
      Returns:
      The elapsed time duration in millis (possibly 0). -1 if called when counter has started but not stopped.