public enum MappedUniqueTimeProvider extends Enum<MappedUniqueTimeProvider> implements net.openhft.chronicle.core.time.TimeProvider, net.openhft.chronicle.core.io.ReferenceOwner
This class utilizes a shared timestamp file, named with the user's name and located in a defined directory, to ensure the uniqueness of timestamps. By default, the file is located in the system's temporary directory.
Each timestamp generated by an instance of this class is globally unique, making it ideal for synchronization and ordering across different threads and processes.
Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
long |
currentTimeMicros() |
long |
currentTimeMillis() |
long |
currentTimeNanos() |
MappedUniqueTimeProvider |
provider(net.openhft.chronicle.core.time.TimeProvider provider) |
static MappedUniqueTimeProvider |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MappedUniqueTimeProvider[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MappedUniqueTimeProvider INSTANCE
public static MappedUniqueTimeProvider[] values()
for (MappedUniqueTimeProvider c : MappedUniqueTimeProvider.values()) System.out.println(c);
public static MappedUniqueTimeProvider 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 MappedUniqueTimeProvider provider(net.openhft.chronicle.core.time.TimeProvider provider)
public long currentTimeMillis()
currentTimeMillis
in interface net.openhft.chronicle.core.time.TimeProvider
public long currentTimeMicros() throws IllegalStateException
currentTimeMicros
in interface net.openhft.chronicle.core.time.TimeProvider
IllegalStateException
public long currentTimeNanos() throws IllegalStateException
currentTimeNanos
in interface net.openhft.chronicle.core.time.TimeProvider
IllegalStateException
Copyright © 2024. All rights reserved.