public interface TimeMeter extends Serializable
SYSTEM_NANOTIME
,
SYSTEM_MILLISECONDS
Modifier and Type | Field and Description |
---|---|
static TimeMeter |
SYSTEM_MILLISECONDS
The implementation of
TimeMeter which works around System.currentTimeMillis() |
static TimeMeter |
SYSTEM_NANOTIME
The implementation of
TimeMeter which works arround System.nanoTime() |
Modifier and Type | Method and Description |
---|---|
long |
currentTimeNanos()
Returns current time in nanosecond precision, but not necessarily nanosecond resolution.
|
default void |
park(long nanosToPark)
Park current thread to required duration of nanoseconds.
|
default void |
parkUninterruptibly(long nanosToPark)
Parks current thread to required duration of nanoseconds ignoring all interrupts,
if interrupt was happen then interruption flag will be restored on the current thread.
|
static final TimeMeter SYSTEM_NANOTIME
TimeMeter
which works arround System.nanoTime()
static final TimeMeter SYSTEM_MILLISECONDS
TimeMeter
which works around System.currentTimeMillis()
long currentTimeNanos()
default void park(long nanosToPark) throws InterruptedException
InterruptedException
in case of current thread was interrupted.nanosToPark
- time to parkInterruptedException
- if current tread is interrupted.default void parkUninterruptibly(long nanosToPark)
nanosToPark
- nanos to parkCopyright © 2017. All rights reserved.