Package io.smallrye.metrics.app
Class TimerImpl.Context
- java.lang.Object
-
- io.smallrye.metrics.app.TimerImpl.Context
-
- All Implemented Interfaces:
Closeable,AutoCloseable,org.eclipse.microprofile.metrics.Timer.Context
- Enclosing class:
- TimerImpl
public static class TimerImpl.Context extends Object implements org.eclipse.microprofile.metrics.Timer.Context
A timing context.- See Also:
TimerImpl.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.Timer.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.Timer.Context
-
-