TimeLine based on System#nanoTime() for the
purpose of handling timeouts. This time source is intentionally not
based on the system clock, in order to not be sensitive to clock skews
caused by changes to the wall clock. Consequently, callers should use
instants returned by this time source solely for the purpose of
comparing them with other instants returned by this same time source.
The granularity of instants returned is identical to the granularity
of System#nanoTime(). This time source has the same property
of monotonicity than the System#nanoTime() it is based on.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private TimeSource. | |
| private static volatile TimeSource. | |
| private static final TimeSource |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Deadline | instant()
Implements jdk. Returns the current instant on this alternative timeline. |
| public static Deadline | Returns: the current instant obtained from the time sourceReturns the current instant obtained from the time source. |
| public static TimeSource |
| localSource | back to summary |
|---|---|
| private TimeSource. | |
| nanoSource | back to summary |
|---|---|
| private static volatile TimeSource. | |
| SOURCE | back to summary |
|---|---|
| private static final TimeSource SOURCE | |
| TimeSource | back to summary |
|---|---|
| private TimeSource() | |
| instant | back to summary |
|---|---|
| public Deadline instant() Implements jdk. Doc from jdk. Returns the current instant on this alternative timeline.
| |
| now | back to summary |
|---|---|
| public static Deadline now() Returns the current instant obtained from the time source. This is equivalent to calling: TimeSource.source().instant();
| |
| source | back to summary |
|---|---|
| public static TimeSource source() Returns the time source.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final Instant | |
| pack-priv final long | |
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv long | |
| pack-priv Deadline | |
| pack-priv Deadline | |
| pack-priv boolean |
| first | back to summary |
|---|---|
| pack-priv final Instant first | |
| firstNanos | back to summary |
|---|---|
| pack-priv final long firstNanos | |
| TIME_WINDOW | back to summary |
|---|---|
| pack-priv static final long TIME_WINDOW | |
| NanoSource | back to summary |
|---|---|
| pack-priv NanoSource() | |
| NanoSource | back to summary |
|---|---|
| pack-priv NanoSource(Instant first, long firstNanos) | |
| delay | back to summary |
|---|---|
| pack-priv long delay(long nanos) | |
| instant | back to summary |
|---|---|
| pack-priv Deadline instant(long nanos) | |
| instant | back to summary |
|---|---|
| pack-priv Deadline instant(long nanos, long delay) | |
| isInWindow | back to summary |
|---|---|
| pack-priv boolean isInWindow(long delay) | |