Class Timer.Context

java.lang.Object
io.dropwizard.metrics5.Timer.Context
All Implemented Interfaces:
AutoCloseable
Enclosing class:
Timer

public static class Timer.Context extends Object implements AutoCloseable
A timing context.
See Also:
  • Method Details

    • stop

      public long stop()
      Updates the timer with the difference between current and start time. Call to this method will not reset the start time. Multiple calls result in multiple updates.
      Returns:
      the elapsed time in nanoseconds
    • close

      public void close()
      Equivalent to calling stop().
      Specified by:
      close in interface AutoCloseable