Package org.apache.cassandra.utils
Interface Clock
- All Known Implementing Classes:
Clock.Default
public interface Clock
Wrapper around time related functions that are either implemented by using the default JVM calls
or by using a custom implementation for testing purposes.
See
Clock.Global.instance for how to use a custom implementation.
Please note that Clock wasn't used, as it would not be possible to provide an
implementation for nanoTime() with the exact same properties of System.nanoTime().-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionlongSemantically equivalent toSystem.currentTimeMillis()longnanoTime()Semantically equivalent toSystem.nanoTime()default longstatic voidwaitUntil(long deadlineNanos)
-
Method Details
-
nanoTime
long nanoTime()Semantically equivalent toSystem.nanoTime() -
currentTimeMillis
long currentTimeMillis()Semantically equivalent toSystem.currentTimeMillis() -
nowInSeconds
default long nowInSeconds() -
waitUntil
- Throws:
InterruptedException
-