java.lang.Object
nz.org.riskscape.engine.function.benchmark.Timer

public class Timer extends Object

Timer to get the mean duration over a series of events.

The start() and stop() methods should wrap the event that is to be timed.

  • Constructor Details

    • Timer

      public Timer(String name)
  • Method Details

    • start

      public void start()

      Start the timer.

    • stop

      public void stop() throws ArithmeticException

      Stop the timer.

      Throws:
      ArithmeticException
    • reset

      public final void reset()

      Reset the timer to initial state.

    • getStats

      public String getStats()
      Returns:
      current stats of this timer