Class Clock.Fast

  • All Implemented Interfaces:, java.lang.AutoCloseable
    Enclosing class:

    public static class Clock.Fast
    extends Clock
    Fast clock implementation whose getTime() method returns instantaneously thanks to a background task that takes care of the actual time-keeping work.
    • Constructor Detail

      • Fast

        public Fast​(java.util.concurrent.ScheduledExecutorService executor)
    • Method Detail

      • getTime

        public long getTime()
        Description copied from class: Clock
        Returns the current time in milliseconds since the epoch.
        Specified by:
        getTime in class Clock
        current time in milliseconds since the epoch
        See Also:
        System.currentTimeMillis(), Clock.millis()
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface