Modifier and Type | Field and Description |
---|---|
private static CoarseCachedClock |
instance |
private static java.lang.Object |
INSTANCE_LOCK |
private long |
millis |
private java.lang.Thread |
updater |
Modifier | Constructor and Description |
---|---|
private |
CoarseCachedClock() |
Modifier and Type | Method and Description |
---|---|
long |
currentTimeMillis()
Returns the value of a private long field that is updated by a background
thread once every millisecond.
|
static CoarseCachedClock |
instance()
Returns the singleton instance.
|
private static volatile CoarseCachedClock instance
private static final java.lang.Object INSTANCE_LOCK
private volatile long millis
private final java.lang.Thread updater
public static CoarseCachedClock instance()
public long currentTimeMillis()
currentTimeMillis
in interface Clock