Enum Class SystemTimer

java.lang.Object
java.lang.Enum<SystemTimer>
com.yahoo.concurrent.SystemTimer
All Implemented Interfaces:
Timer, Serializable, Comparable<SystemTimer>, Constable

public enum SystemTimer extends Enum<SystemTimer> implements Timer
This is an implementation of Timer that is backed by an actual system timer.
Author:
Simon Thoresen Hult
  • Enum Constant Details

  • Method Details

    • values

      public static SystemTimer[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static SystemTimer valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • detectHz

      public static long detectHz()
    • adjustTimeoutByDetectedHz

      public static Duration adjustTimeoutByDetectedHz(Duration timeout)
    • adjustTimeoutByDetectedHz

      public static Duration adjustTimeoutByDetectedHz(Duration timeout, long hz)
    • milliTime

      public long milliTime()
      Description copied from interface: Timer
      Returns the current value of some arbitrary timer, in milliseconds. This method can only be used to measure elapsed time and is not related to any other notion of system or wall-clock time.
      Specified by:
      milliTime in interface Timer
      Returns:
      The current value of the timer, in milliseconds.