Interface Timer.Sample

All Known Implementing Classes:
Timer.DefaultSample
Enclosing interface:
Timer

public static interface Timer.Sample
Maintains state on the clock's start position for a latency sample. Complete the timing by calling stop(Timer). Note how the Timer isn't provided until the sample is stopped, allowing you to determine the timer's tags at the last minute.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    stop(Timer timer)
    Records the duration of the operation.
  • Method Details

    • stop

      long stop(Timer timer)
      Records the duration of the operation.
      Parameters:
      timer - The timer to record the sample to.
      Returns:
      The total duration of the sample in nanoseconds