Class Clock

  • Direct Known Subclasses:
    MillisClock, TestClock, ZeroTimeClock

    public abstract class Clock
    extends java.lang.Object
    Interface for getting the current time.
    Since:
    0.5
    • Constructor Summary

      Constructors 
      Constructor Description
      Clock()  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      abstract Timestamp now()
      Obtains the current instant from this clock.
      abstract long nowNanos()
      Returns a time measurement with nanosecond precision that can only be used to calculate elapsed time.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Clock

        public Clock()
    • Method Detail

      • now

        public abstract Timestamp now()
        Obtains the current instant from this clock.
        Returns:
        the current instant.
        Since:
        0.5
      • nowNanos

        public abstract long nowNanos()
        Returns a time measurement with nanosecond precision that can only be used to calculate elapsed time.
        Returns:
        a time measurement with nanosecond precision that can only be used to calculate elapsed time.
        Since:
        0.5