Package org.apache.flink.util.clock
Class SystemClock
- java.lang.Object
-
- org.apache.flink.util.clock.Clock
-
- org.apache.flink.util.clock.SystemClock
-
- All Implemented Interfaces:
RelativeClock
@PublicEvolving public final class SystemClock extends Clock
A clock that returns the time of the system / process.This clock uses
System.currentTimeMillis()
for absolute time andSystem.nanoTime()
for relative time.This SystemClock exists as a singleton instance.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
getInstance
public static SystemClock getInstance()
-
absoluteTimeMillis
public long absoluteTimeMillis()
Description copied from class:Clock
Gets the current absolute time, in milliseconds.- Specified by:
absoluteTimeMillis
in classClock
-
relativeTimeMillis
public long relativeTimeMillis()
Description copied from class:Clock
Gets the current relative time, in milliseconds.- Specified by:
relativeTimeMillis
in interfaceRelativeClock
- Specified by:
relativeTimeMillis
in classClock
-
relativeTimeNanos
public long relativeTimeNanos()
Description copied from class:Clock
Gets the current relative time, in nanoseconds.- Specified by:
relativeTimeNanos
in interfaceRelativeClock
- Specified by:
relativeTimeNanos
in classClock
-
-