Class ZeroTimeClock


  • @Immutable
    public final class ZeroTimeClock
    extends Clock
    A Clock that always returns 0.
    • Field Detail

      • ZERO_TIMESTAMP

        private static final Timestamp ZERO_TIMESTAMP
    • Constructor Detail

      • ZeroTimeClock

        private ZeroTimeClock()
    • Method Detail

      • getInstance

        public static ZeroTimeClock getInstance()
        Returns a ZeroTimeClock.
        Returns:
        a ZeroTimeClock.
      • now

        public Timestamp now()
        Description copied from class: Clock
        Obtains the current instant from this clock.
        Specified by:
        now in class Clock
        Returns:
        the current instant.
      • nowNanos

        public long nowNanos()
        Description copied from class: Clock
        Returns a time measurement with nanosecond precision that can only be used to calculate elapsed time.
        Specified by:
        nowNanos in class Clock
        Returns:
        a time measurement with nanosecond precision that can only be used to calculate elapsed time.