Interface Clock
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface Clock
An abstraction for how time passes. It is passed toTimer
to track timing.
-
-
Field Summary
Fields Modifier and Type Field Description static Clock
DEFAULT
A clock implementation which returns the current time in epoch nanoseconds.static Clock
THREAD_CPU_TIME
A clock implementation which returns the current thread's CPU time.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static Clock
defaultClock()
The default clock to use.long
getTick()
Returns the current time tick.default long
getTime()
Returns the current time in milliseconds.
-