Class SystemTime

  • All Implemented Interfaces:
    Time

    public class SystemTime
    extends java.lang.Object
    implements Time
    Time implementation that just reads from the system clock
    • Field Detail

      • INSTANCE

        public static final SystemTime INSTANCE
    • Constructor Detail

      • SystemTime

        public SystemTime()
    • Method Detail

      • getCurrentDate

        public java.util.Date getCurrentDate()
      • getMilliseconds

        public long getMilliseconds()
        Specified by:
        getMilliseconds in interface Time
      • getNanoseconds

        public long getNanoseconds()
        Specified by:
        getNanoseconds in interface Time
      • getSeconds

        public int getSeconds()
      • sleep

        public void sleep​(long ms)
                   throws java.lang.InterruptedException
        Specified by:
        sleep in interface Time
        Throws:
        java.lang.InterruptedException