@FunctionalInterface public interface TimeProvider
There are a number of implementations. The simplest and fastest are PosixTimeProvider and
SystemTimeProvider, with PosixTimeProvider recommended as being faster, more accurate and
more stable, although it does make use of native code.
| Modifier and Type | Method and Description |
|---|---|
default long |
currentTime(TimeUnit timeUnit)
Deprecated.
|
default long |
currentTimeMicros() |
long |
currentTimeMillis() |
default long |
currentTimeNanos() |
long currentTimeMillis()
default long currentTimeMicros()
throws IllegalStateException
IllegalStateExceptiondefault long currentTimeNanos()
throws IllegalStateException
IllegalStateException@Deprecated default long currentTime(TimeUnit timeUnit) throws IllegalStateException
IllegalStateExceptionCopyright © 2023. All rights reserved.