public static enum Chronometer.Precision extends java.lang.Enum<Chronometer.Precision>
Enum Constant and Description |
---|
Milliseconds
Use
System.currentTimeMillis() to obtain current time. |
Nanoseconds
Use
System.nanoTime() to obtain current time |
Modifier and Type | Method and Description |
---|---|
static Chronometer.Precision |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Chronometer.Precision[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Chronometer.Precision Milliseconds
System.currentTimeMillis()
to obtain current time.
This will usually be the cheapest method.
public static final Chronometer.Precision Nanoseconds
System.nanoTime()
to obtain current time
This method will be more precise than Milliseconds
, but
it is also likely to be more expensive and more sensitive to low level OS issues,
especially regarding clock syncing across multiple cores.
public static Chronometer.Precision[] values()
for (Chronometer.Precision c : Chronometer.Precision.values()) System.out.println(c);
public static Chronometer.Precision valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified namejava.lang.NullPointerException
- if the argument is null