public class SetTimeProvider extends Object implements TimeProvider
Constructor and Description |
---|
SetTimeProvider() |
SetTimeProvider(long initialNanos) |
Modifier and Type | Method and Description |
---|---|
SetTimeProvider |
advanceMicros(long micros)
Advances time in microseconds.
|
SetTimeProvider |
advanceMillis(long millis)
Advances time in milliseconds.
|
SetTimeProvider |
advanceNanos(long nanos)
Advances time in nanoseconds.
|
long |
currentTime(TimeUnit unit) |
long |
currentTimeMicros() |
void |
currentTimeMicros(long micros)
Set the current time in microseconds.
|
long |
currentTimeMillis() |
void |
currentTimeMillis(long millis)
Set the current time in milliseconds.
|
long |
currentTimeNanos() |
void |
currentTimeNanos(long nanos)
Set the current time in nanoseconds.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
get
public SetTimeProvider()
public SetTimeProvider(long initialNanos)
public void currentTimeMillis(long millis)
millis
- New time value in milliseconds since the epoch. May not be less than the previous value.public long currentTimeMillis()
currentTimeMillis
in interface TimeProvider
public void currentTimeMicros(long micros)
micros
- New time value in microseconds since the epoch. May not be less than the previous value.public long currentTimeMicros()
currentTimeMicros
in interface TimeProvider
public void currentTimeNanos(long nanos)
nanos
- New time value in nanoseconds since the epoch. May not be less than the previous value.public long currentTimeNanos()
currentTimeNanos
in interface TimeProvider
public long currentTime(TimeUnit unit)
currentTime
in interface TimeProvider
public SetTimeProvider advanceMillis(long millis)
millis
- duration.public SetTimeProvider advanceMicros(long micros)
micros
- duration.public SetTimeProvider advanceNanos(long nanos)
nanos
- duration.Copyright © 2018. All rights reserved.