public class CachedNanoClock extends Object implements NanoClock
NanoClock
that caches a timestamp which can be updated with update(long)
.
Instances are threadsafe with the read being volatile.
Modifier and Type | Field and Description |
---|---|
protected long |
p1 |
protected long |
p2 |
protected long |
p3 |
protected long |
p4 |
protected long |
p5 |
protected long |
p6 |
protected long |
p7 |
protected long |
timeNs |
Constructor and Description |
---|
CachedNanoClock() |
Modifier and Type | Method and Description |
---|---|
long |
nanoTime()
The number of ticks in nanoseconds the clock has advanced since starting.
|
void |
update(long timeNs)
Update the value of the timestamp with release memory ordered semantics.
|
protected long p1
protected long p2
protected long p3
protected long p4
protected long p5
protected long p6
protected long p7
protected volatile long timeNs
Copyright © 2014-2019 Real Logic Ltd. All Rights Reserved.