-
public interface TimeMeterAn abstraction over time measurement.- See Also:
SYSTEM_NANOTIME,SYSTEM_MILLISECONDS
-
-
Field Summary
Fields Modifier and Type Field Description static TimeMeterSYSTEM_MILLISECONDSThe implementation ofTimeMeterwhich works aroundSystem.currentTimeMillis()static TimeMeterSYSTEM_NANOTIMEThe implementation ofTimeMeterwhich works aroundSystem.nanoTime()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description longcurrentTimeNanos()Returns current time in nanosecond precision, but not necessarily nanosecond resolution.booleanisWallClockBased()Returnstrueif implementation of clock behaves the similar way asSystem.currentTimeMillis(), in other words if implementation can be used as wall clock.
-
-
-
Field Detail
-
SYSTEM_NANOTIME
static final TimeMeter SYSTEM_NANOTIME
The implementation ofTimeMeterwhich works aroundSystem.nanoTime()
-
SYSTEM_MILLISECONDS
static final TimeMeter SYSTEM_MILLISECONDS
The implementation ofTimeMeterwhich works aroundSystem.currentTimeMillis()
-
-
Method Detail
-
currentTimeNanos
long currentTimeNanos()
Returns current time in nanosecond precision, but not necessarily nanosecond resolution.- Returns:
- current time in nanoseconds
-
isWallClockBased
boolean isWallClockBased()
Returnstrueif implementation of clock behaves the similar way asSystem.currentTimeMillis(), in other words if implementation can be used as wall clock.- Returns:
trueif implementation can be used as wall clock
-
-