public class CachedNanoClock extends java.lang.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 |
p10 |
protected long |
p11 |
protected long |
p12 |
protected long |
p13 |
protected long |
p14 |
protected long |
p15 |
protected long |
p2 |
protected long |
p3 |
protected long |
p4 |
protected long |
p5 |
protected long |
p6 |
protected long |
p7 |
protected long |
p8 |
protected long |
p9 |
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 memory ordered semantics.
|
void |
updateWeak(long timeNs)
Update the value of the timestamp in with weak ordering semantics.
|
protected long p1
protected long p2
protected long p3
protected long p4
protected long p5
protected long p6
protected long p7
protected long p8
protected long p9
protected long p10
protected long p11
protected long p12
protected long p13
protected long p14
protected long p15
protected volatile long timeNs
public long nanoTime()
NanoClock
public void update(long timeNs)
timeNs
- value to update the timestamp.public void updateWeak(long timeNs)
timeNs
- value to update the timestamp.Copyright © 2014-2018 Real Logic Ltd. All Rights Reserved.