Class SystemClock


  • public final class SystemClock
    extends Clock
    Default millisecond precision clock.

    See class documentation in Clock for important implementation restrictions.

    • Method Detail

      • getInstance

        public static SystemClock getInstance()
      • getCurrentTimeNanos

        public long getCurrentTimeNanos()
        Description copied from class: Clock
        Returns the current time from the epoch (00:00 1st Jan, 1970) with nanosecond granularity, though not necessarily nanosecond precision. This clock measures UTC and is not required to handle leap seconds.
        Specified by:
        getCurrentTimeNanos in class Clock
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object