Package io.smallrye.metrics.app
Class SimpleTimerImpl.Context
- java.lang.Object
-
- io.smallrye.metrics.app.SimpleTimerImpl.Context
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.eclipse.microprofile.metrics.SimpleTimer.Context
- Enclosing class:
- SimpleTimerImpl
public static class SimpleTimerImpl.Context extends Object implements org.eclipse.microprofile.metrics.SimpleTimer.Context
A timing context.- See Also:
SimpleTimerImpl.time()
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Equivalent to callingstop().longstop()Updates the timer with the difference between current and start time.
-
-
-
Method Detail
-
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.- Specified by:
stopin interfaceorg.eclipse.microprofile.metrics.SimpleTimer.Context- Returns:
- the elapsed time in nanoseconds
-
close
public void close()
Equivalent to callingstop().- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.eclipse.microprofile.metrics.SimpleTimer.Context
-
-