Package 

Interface TimeSource


  • 
    public interface TimeSource
    
                        

    Interface to retrieve various time primitives. Limited by the granularity of the underlying platform.

    • Method Summary

      Modifier and Type Method Description
      abstract long getNanoTicks() Returns monotonically increasing ticks from some arbitrary start point.
      abstract long getCurrentTimeMillis() Milliseconds since the start of the epoch
      abstract long getCurrentTimeMicros() Microseconds since the start of the epoch
      abstract long getCurrentTimeNanos() Nanoseconds since the start of the epoch.
      • Methods inherited from class java.lang.Object

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

      • getNanoTicks

         abstract long getNanoTicks()

        Returns monotonically increasing ticks from some arbitrary start point. Should only be used tomeasure durations. Negative numbers and zero are both valid return values

      • getCurrentTimeMillis

         abstract long getCurrentTimeMillis()

        Milliseconds since the start of the epoch

      • getCurrentTimeMicros

         abstract long getCurrentTimeMicros()

        Microseconds since the start of the epoch

      • getCurrentTimeNanos

         abstract long getCurrentTimeNanos()

        Nanoseconds since the start of the epoch. Valid for the time range 1/1/1970 +/- 270 years