public static enum Counter.Type extends Enum<Counter.Type>
| Enum Constant and Description |
|---|
CPU_TIME
The total time spent using a CPU for the current thread.
|
SYSTEM_TIME
The time spent by the OS kernel to execute system level operations on behalf of the
application, such as context switching, resource allocation, etc.
|
USER_TIME
The total CPU time that the current thread has executed in user mode (i.e., the time
spent running current thread's code).
|
WALL_CLOCK_TIME
The elapsed time experienced by a user waiting for a task to complete.
|
| Modifier and Type | Method and Description |
|---|---|
abstract long |
getTime(TimeUnit timeUnit)
Executes a particular time fetching mode that varies for each counter type.
|
String |
toString()
Returns the textual representation associated with this type.
|
static Counter.Type |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Counter.Type[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Counter.Type WALL_CLOCK_TIME
public static final Counter.Type CPU_TIME
public static final Counter.Type USER_TIME
public static final Counter.Type SYSTEM_TIME
public static Counter.Type[] values()
for (Counter.Type c : Counter.Type.values()) System.out.println(c);
public static Counter.Type 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 String toString()
toString in class Enum<Counter.Type>public abstract long getTime(TimeUnit timeUnit)
timeUnit - the time unit in which the time will be returnedCopyright © 2023. All rights reserved.