Package com.backblaze.b2.util
Class B2ClockImpl
- java.lang.Object
-
- com.backblaze.b2.util.B2Clock
-
- com.backblaze.b2.util.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 Summary
Constructors Constructor Description B2ClockImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
monotonicMillis()
long
wallClockMillis()
-
Methods inherited from class com.backblaze.b2.util.B2Clock
get, useSimulator
-
-
-
-
Method Detail
-
monotonicMillis
public long monotonicMillis()
- Specified by:
monotonicMillis
in classB2Clock
- 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 classB2Clock
- 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.
-
-