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. SeeClock.Global.instance
for how to use a custom implementation. Please note thatClock
wasn't used, as it would not be possible to provide an implementation fornanoTime()
with the exact same properties ofSystem.nanoTime()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Clock.Default
static class
Clock.Global
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description long
currentTimeMillis()
Semantically equivalent toSystem.currentTimeMillis()
long
nanoTime()
Semantically equivalent toSystem.nanoTime()
default long
nowInSeconds()
static void
waitUntil(long deadlineNanos)
-
-
-
Method Detail
-
nanoTime
long nanoTime()
Semantically equivalent toSystem.nanoTime()
-
currentTimeMillis
long currentTimeMillis()
Semantically equivalent toSystem.currentTimeMillis()
-
nowInSeconds
default long nowInSeconds()
-
waitUntil
static void waitUntil(long deadlineNanos) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
-