MonotonicClock (Apache Hadoop Main 3.5.0 API)
Description: declaration: package: org.apache.hadoop.yarn.util, class: MonotonicClock

Package org.apache.hadoop.yarn.util

# Class MonotonicClock

java.lang.Object
org.apache.hadoop.yarn.util.MonotonicClock

All Implemented Interfaces:
  `Clock`

@Public @Evolving public class MonotonicClock extends Object implements Clock
A monotonic clock from some arbitrary time base in the past, counting in milliseconds, and not affected by settimeofday or similar system clock changes. This is appropriate to use when computing how much longer to wait for an interval to expire. This function can return a negative value and it must be handled correctly by callers. See the documentation of System#nanoTime for caveats.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `MonotonicClock()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `long`
  `getTime()`
  Get current time from some arbitrary time base in the past, counting in milliseconds, and not affected by settimeofday or similar system clock changes.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### MonotonicClock

    public MonotonicClock()

- ## Method Details

  - ### getTime

    public long getTime()
    Get current time from some arbitrary time base in the past, counting in milliseconds, and not affected by settimeofday or similar system clock changes.
    Specified by:
      `getTime` in interface `Clock`
    Returns:
      a monotonic clock that counts in milliseconds.