@PublicEvolving public final class SystemClock extends Clock
This clock uses System.currentTimeMillis()
for absolute time and System.nanoTime()
for relative time.
This SystemClock exists as a singleton instance.
Modifier and Type | Method and Description |
---|---|
long |
absoluteTimeMillis()
Gets the current absolute time, in milliseconds.
|
static SystemClock |
getInstance() |
long |
relativeTimeMillis()
Gets the current relative time, in milliseconds.
|
long |
relativeTimeNanos()
Gets the current relative time, in nanoseconds.
|
public static SystemClock getInstance()
public long absoluteTimeMillis()
Clock
absoluteTimeMillis
in class Clock
public long relativeTimeMillis()
Clock
relativeTimeMillis
in interface RelativeClock
relativeTimeMillis
in class Clock
public long relativeTimeNanos()
Clock
relativeTimeNanos
in interface RelativeClock
relativeTimeNanos
in class Clock
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.