public interface Timepoint extends Comparable<Timepoint>
TimestampProvider| Modifier and Type | Method and Description |
|---|---|
Timepoint |
add(Duration addend)
Returns a new Timepoint which is the given duration later in time.
|
long |
getNativeTimestamp()
Returns the elapsed time since UNIX epoch of this time point in the native unit.
|
TimeUnit |
getNativeUnit()
Returns the native time unit of this time point as given by the backing
TimestampProvider. |
TimestampProvider |
getProvider()
Returns the backing
TimestampProvider. |
long |
getTimestamp(TimeUnit targetUnit)
Returns this timepoint as the elapsed time since UNIX epoch in the given time unit.
|
Timepoint |
sleepPast()
Causes this thread to sleep past this time point.
|
Timepoint |
sub(Duration subtrahend)
Returns a new Timepoint that is the given duration earlier in time.
|
compareTolong getTimestamp(TimeUnit targetUnit)
targetUnit - Timepoint add(Duration addend)
addend - Timepoint sub(Duration subtrahend)
subtrahend - TimeUnit getNativeUnit()
TimestampProvider.
Equivalent to getProvider().getUnit().long getNativeTimestamp()
getTimestamp(getNativeUnit())TimestampProvider getProvider()
TimestampProvider.Timepoint sleepPast() throws InterruptedException
InterruptedExceptionCopyright © 2012–2014. All rights reserved.