Interface RelativeClock

  • All Known Implementing Classes:
    Clock, ManualClock, SystemClock

    @PublicEvolving
    public interface RelativeClock
    A clock that gives access to relative time, similar to System#nanoTime(), however the progress of the relative time doesn't have to reflect the progress of a wall clock. Concrete classes can specify a different contract in that regard. Returned time must be monotonically increasing.
    • Method Detail

      • relativeTimeMillis

        long relativeTimeMillis()
        Gets the current relative time, in milliseconds.
      • relativeTimeNanos

        long relativeTimeNanos()
        Gets the current relative time, in nanoseconds.