Class Clock.CacheClock

java.lang.Object
me.ahoo.cosid.util.Clock.CacheClock
All Implemented Interfaces:
Runnable, Clock
Enclosing interface:
Clock

public static class Clock.CacheClock extends Object implements Clock, Runnable
Fix the problem that System.currentTimeMillis() is too slow. The accuracy is 1 second
  • Field Details

    • ONE_SECOND_PERIOD

      public static final long ONE_SECOND_PERIOD
      Tolerate a one-second time limit.
  • Constructor Details

    • CacheClock

      public CacheClock(Clock clock)
  • Method Details

    • secondTime

      public long secondTime()
      Specified by:
      secondTime in interface Clock
    • run

      public void run()
      Specified by:
      run in interface Runnable