Package io.dropwizard.metrics5
Class Timer.Context
java.lang.Object
io.dropwizard.metrics5.Timer.Context
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- Timer
A timing context.
- See Also:
-
Method Summary
-
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 callingstop()
.- Specified by:
close
in interfaceAutoCloseable
-