public enum PosixTimeProvider extends Enum<PosixTimeProvider> implements TimeProvider
PosixTimeProvider calls directly into clock_gettime (native code) to get the nanosecond wall clock on platforms which support it.
| Enum Constant and Description |
|---|
INSTANCE |
| Modifier and Type | Method and Description |
|---|---|
long |
currentTimeMicros() |
long |
currentTimeMillis() |
long |
currentTimeNanos() |
static PosixTimeProvider |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PosixTimeProvider[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOfcurrentTimepublic static final PosixTimeProvider INSTANCE
public static PosixTimeProvider[] values()
for (PosixTimeProvider c : PosixTimeProvider.values()) System.out.println(c);
public static PosixTimeProvider valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic long currentTimeMillis()
currentTimeMillis in interface TimeProviderpublic long currentTimeMicros()
throws IllegalStateException
currentTimeMicros in interface TimeProviderIllegalStateExceptionpublic long currentTimeNanos()
currentTimeNanos in interface TimeProviderCopyright © 2023. All rights reserved.