public static final class TimeSource.SimTimeSource extends TimeSource
TimeSource.NANO_TIME
accelerated by a double multiplier.TimeSource.CurrentTimeSource, TimeSource.NanoTimeSource, TimeSource.SimTimeSource
CURRENT_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) |
get
public SimTimeSource(double multiplier)
multiplier
- must be greater than 0.0public void advance(long delta)
public long getTime()
TimeSource
getTime
in class TimeSource
public void sleep(long ms) throws InterruptedException
sleep
in class TimeSource
InterruptedException
public long convertDelay(TimeUnit fromUnit, long value, TimeUnit toUnit)
convertDelay
in class TimeSource
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.