Class B2ClockImpl


  • public class B2ClockImpl
    extends B2Clock
    B2ClockImpl uses values from the System class to provide a "real" implementation of B2Clock whose clocks are determined by the system.
    • Constructor Detail

      • B2ClockImpl

        public B2ClockImpl()
    • Method Detail

      • monotonicMillis

        public long monotonicMillis()
        Specified by:
        monotonicMillis in class B2Clock
        Returns:
        a monotonically increasing number of milliseconds. note that it has no relationship to wall clock time and will differ between different runs of the JVM. It is monotonically increasing! AND it won't wrap during any single run of a JVM. (unless the JVM runs for hundreds of of years! (2^63 nanos) / (10^9 nanos/sec) / (86400 secs/day) / (365 days/year) ~= 292 years)
      • wallClockMillis

        public long wallClockMillis()
        Specified by:
        wallClockMillis in class B2Clock
        Returns:
        the number of milliseconds since the unix epoch. may be negative if now is before the epoch. the values returned by this represent wall clock time and might not be monotonic if the system clock is changed. time might sometimes flow at a variable speed or even backwards if the clock is being adjusted.