Package com.yahoo.concurrent
Enum Class SystemTimer
- All Implemented Interfaces:
Timer
,Serializable
,Comparable<SystemTimer>
,Constable
This is an implementation of
Timer
that is backed by an actual system timer.- Author:
- Simon Thoresen Hult
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Duration
adjustTimeoutByDetectedHz
(Duration timeout) static Duration
adjustTimeoutByDetectedHz
(Duration timeout, long hz) static long
detectHz()
long
Returns the current value of some arbitrary timer, in milliseconds.static SystemTimer
Returns the enum constant of this class with the specified name.static SystemTimer[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
detectHz
public static long detectHz() -
adjustTimeoutByDetectedHz
-
adjustTimeoutByDetectedHz
-
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.
-