public class DeltaTimestampStrategy extends Object implements TimestampStrategy
TimestampStrategy that provides
nanosecond resolution.
It implements a Clock that simulates a nanoseconds resolution by
calculating the difference (delta) between subsequent calls to the method
System.nanoTime(). This class provides nanosecond precision, but not
necessarily nanosecond resolution.
It's slower than NanosecondTimestampStrategy and
DefaultTimestampStrategy.| Modifier and Type | Class and Description |
|---|---|
static class |
DeltaTimestampStrategy.NanosClock
Clock class responsible to create instants with nanoseconds.
|
| Modifier and Type | Field and Description |
|---|---|
protected static DeltaTimestampStrategy.NanosClock |
clock |
protected static long |
GREGORIAN_SECONDS |
protected static long |
NANOSECONDS_PER_SECOND |
protected static long |
TIMESTAMP_RESOLUTION |
| Constructor and Description |
|---|
DeltaTimestampStrategy() |
| Modifier and Type | Method and Description |
|---|---|
long |
getTimestamp() |
protected static final long NANOSECONDS_PER_SECOND
protected static final long TIMESTAMP_RESOLUTION
protected static final long GREGORIAN_SECONDS
protected static final DeltaTimestampStrategy.NanosClock clock
public long getTimestamp()
getTimestamp in interface TimestampStrategyCopyright © 2019. All rights reserved.