Interface SimpleTimer.Context

All Superinterfaces:
AutoCloseable, Closeable
Enclosing interface:
SimpleTimer

public static interface SimpleTimer.Context extends Closeable
A timing context.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Equivalent to calling stop().
    long
    Updates the simple timer with the difference between current and start time.
  • Method Details

    • stop

      long stop()
      Updates the simple 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 AutoCloseable
      Specified by:
      close in interface Closeable