@PublicEvolving public final class ManualClock extends Clock
Clock
implementation which allows to advance time manually.Constructor and Description |
---|
ManualClock() |
ManualClock(long startTime) |
Modifier and Type | Method and Description |
---|---|
long |
absoluteTimeMillis()
Gets the current absolute time, in milliseconds.
|
void |
advanceTime(java.time.Duration duration)
Advances the time by the given duration.
|
void |
advanceTime(long duration,
TimeUnit timeUnit)
Advances the time by the given duration.
|
long |
relativeTimeMillis()
Gets the current relative time, in milliseconds.
|
long |
relativeTimeNanos()
Gets the current relative time, in nanoseconds.
|
public long absoluteTimeMillis()
Clock
absoluteTimeMillis
in class Clock
public long relativeTimeMillis()
Clock
relativeTimeMillis
in class Clock
public long relativeTimeNanos()
Clock
relativeTimeNanos
in class Clock
public void advanceTime(long duration, TimeUnit timeUnit)
public void advanceTime(java.time.Duration duration)
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.