Interface Timer.Context

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable
    Enclosing interface:
    Timer

    public static interface Timer.Context
    extends java.io.Closeable
    A timing context.
    See Also:
    Timer.time()
    • Method Detail

      • stop

        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

        void close()
        Equivalent to calling stop().
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable