Class 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 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:
        stop in interface org.eclipse.microprofile.metrics.Timer.Context
        Returns:
        the elapsed time in nanoseconds
      • close

        public void close()
        Equivalent to calling stop().
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface Closeable
        Specified by:
        close in interface org.eclipse.microprofile.metrics.Timer.Context