@PublicEvolving public abstract class Clock extends Object
This refers to real world wall clock time, and it is typically
derived from a system clock. It is subject to clock drift and inaccuracy, and can jump if the
system clock is adjusted. Absolute time behaves similar to
This time advances at the same speed as the absolute time,
but the timestamps can only be referred to relative to each other. The timestamps have no
absolute meaning and cannot be compared across JVM processes. The source for the timestamps is
not affected by adjustments to the system clock, so it never jumps. Relative time behaves similar
|Constructor and Description|
|Modifier and Type||Method and Description|
Gets the current absolute time, in milliseconds.
Gets the current relative time, in milliseconds.
Gets the current relative time, in nanoseconds.
public abstract long absoluteTimeMillis()
public abstract long relativeTimeMillis()
public abstract long relativeTimeNanos()
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.