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
Enum Constants -
Field Summary
Fields inherited from interface com.yahoo.concurrent.Timer
creationNanos, monotonic -
Method Summary
Modifier and TypeMethodDescriptionstatic DurationadjustTimeoutByDetectedHz(Duration timeout) static DurationadjustTimeoutByDetectedHz(Duration timeout, long hz) static longdetectHz()longReturns the current value of some arbitrary timer, in milliseconds.static SystemTimerReturns 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:TimerReturns 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.
-