Class Timer.Context

java.lang.Object
com.codahale.metrics.Timer.Context
All Implemented Interfaces:
Closeable, AutoCloseable
Enclosing class:
Timer

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

    • timer

      private final Timer timer
    • clock

      private final Clock clock
    • startTime

      private final long startTime
  • Constructor Details

    • Context

      private Context(Timer timer, Clock clock)
  • Method Details

    • stop

      public long stop()
      Stops recording the elapsed time, updates the timer and returns the elapsed time in nanoseconds.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable