public class SetTimeProvider extends Object implements TimeProvider
Created by Peter Lawrey on 10/03/16.
| 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, waitgetpublic 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 TimeProviderpublic 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 TimeProviderpublic 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 TimeProviderpublic long currentTime(TimeUnit unit)
currentTime in interface TimeProviderpublic 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.