public class NanoClock
extends java.lang.Object
System.currentTimeMillis()
* 1000_000, but it increases smoothly
between neighboring milliseconds.Modifier and Type | Field and Description |
---|---|
private static int |
ADJUSTMENT_BACK_SAFETY_INTERVAL |
private static long |
ADJUSTMENT_STEP_MS |
private static java.lang.Object |
monitor |
private static long |
nanoOffset |
private static long |
RAPID_FORWARD_ADJUSTMENT_THRESHOLD_MS
When clock moves forward by more then this value it will be rapidly adjusted.
|
private static long |
stopUntil |
private static long |
stopValue |
Constructor and Description |
---|
NanoClock() |
Modifier and Type | Method and Description |
---|---|
static long |
currentTimeNanos()
Get current time in nanoseconds.
|
private static final long ADJUSTMENT_STEP_MS
private static final int ADJUSTMENT_BACK_SAFETY_INTERVAL
private static final long RAPID_FORWARD_ADJUSTMENT_THRESHOLD_MS
private static long nanoOffset
private static long stopUntil
private static long stopValue
private static final java.lang.Object monitor