Class SystemTime

  • All Implemented Interfaces:
    Time

    public class SystemTime
    extends Object
    implements Time
    • Constructor Detail

      • SystemTime

        public SystemTime()
    • Method Detail

      • milliseconds

        public long milliseconds()
        Returns the current time in milliseconds.
        Specified by:
        milliseconds in interface Time
      • nanoseconds

        public long nanoseconds()
        Returns the current value of the running JVM's high-resolution time source, in nanoseconds.
        Specified by:
        nanoseconds in interface Time
      • sleep

        public void sleep​(Duration duration)
        Specified by:
        sleep in interface Time