Module stormpot

Class NanoClock

java.lang.Object
stormpot.internal.NanoClock

public final class NanoClock extends Object
Convenience functions for operating on relative nanosecond time spans.
  • Method Details

    • nanoTime

      public static long nanoTime()
      Equivalent of System.nanoTime().
      Returns:
      The current timestamp in nanoseconds.
      See Also:
    • elapsed

      public static long elapsed(long startNanos)
      Compute the number of nanoseconds passed since the given start time.
      Parameters:
      startNanos - The starting timestamp, obtained from nanoTime().
      Returns:
      The elapsed time since the start time, in nanoseconds.