Class SystemEpochClock

  • All Implemented Interfaces:
    EpochClock

    public class SystemEpochClock
    extends java.lang.Object
    implements EpochClock
    Implementation that calls System.currentTimeMillis().
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static SystemEpochClock INSTANCE
      As there is no instance state then this object can be used to save on allocation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long time()
      Time in milliseconds since 1 Jan 1970 UTC.
      • Methods inherited from class java.lang.Object

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

      • INSTANCE

        public static final SystemEpochClock INSTANCE
        As there is no instance state then this object can be used to save on allocation.
    • Constructor Detail

      • SystemEpochClock

        public SystemEpochClock()
    • Method Detail

      • time

        public long time()
        Time in milliseconds since 1 Jan 1970 UTC.
        Specified by:
        time in interface EpochClock
        Returns:
        the number of milliseconds since 1 Jan 1970 UTC.
        See Also:
        System.currentTimeMillis()