public interface Clock
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()
.Modifier and Type | Interface and Description |
---|---|
static class |
Clock.Default |
static class |
Clock.Global |
Modifier and Type | Method and Description |
---|---|
long |
currentTimeMillis()
Semantically equivalent to
System.currentTimeMillis() |
long |
nanoTime()
Semantically equivalent to
System.nanoTime() |
static void |
waitUntil(long deadlineNanos) |
long nanoTime()
System.nanoTime()
long currentTimeMillis()
System.currentTimeMillis()
static void waitUntil(long deadlineNanos) throws java.lang.InterruptedException
java.lang.InterruptedException
Copyright © 2009-2022 The Apache Software Foundation