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 longabsoluteTimeMillis()Gets the current absolute time, in milliseconds.static SystemClockgetInstance()longrelativeTimeMillis()Gets the current relative time, in milliseconds.longrelativeTimeNanos()Gets the current relative time, in nanoseconds.
-
-
-
Method Detail
-
getInstance
public static SystemClock getInstance()
-
absoluteTimeMillis
public long absoluteTimeMillis()
Description copied from class:ClockGets the current absolute time, in milliseconds.- Specified by:
absoluteTimeMillisin classClock
-
relativeTimeMillis
public long relativeTimeMillis()
Description copied from class:ClockGets the current relative time, in milliseconds.- Specified by:
relativeTimeMillisin interfaceRelativeClock- Specified by:
relativeTimeMillisin classClock
-
relativeTimeNanos
public long relativeTimeNanos()
Description copied from class:ClockGets the current relative time, in nanoseconds.- Specified by:
relativeTimeNanosin interfaceRelativeClock- Specified by:
relativeTimeNanosin classClock
-
-