public static final class TimeSource.SimTimeSource extends TimeSource
TimeSource.NANO_TIME accelerated by a double multiplier.TimeSource.CurrentTimeSource, TimeSource.NanoTimeSource, TimeSource.SimTimeSourceCURRENT_TIME, NANO_TIME| Constructor and Description |
|---|
SimTimeSource(double multiplier)
Create a simulated time source that runs faster than real time by a multipler.
|
| Modifier and Type | Method and Description |
|---|---|
void |
advance(long delta) |
long |
convertDelay(TimeUnit fromUnit,
long value,
TimeUnit toUnit) |
long |
getTime()
Return a time value, in nanosecond unit.
|
void |
sleep(long ms) |
getpublic SimTimeSource(double multiplier)
multiplier - must be greater than 0.0public void advance(long delta)
public long getTime()
TimeSourcegetTime in class TimeSourcepublic void sleep(long ms)
throws InterruptedException
sleep in class TimeSourceInterruptedExceptionpublic long convertDelay(TimeUnit fromUnit, long value, TimeUnit toUnit)
convertDelay in class TimeSourceCopyright © 2000-2018 Apache Software Foundation. All Rights Reserved.