public class CpuTime extends Object
Modifier and Type | Field and Description |
---|---|
static long |
CPU_RATE
CPU speed in cycles per millisecond.
|
static boolean |
CPU_TIME_SUPPORTED
Flag that is true iff on the target system CPU usage monitoring
is supported.
|
Constructor and Description |
---|
CpuTime() |
Modifier and Type | Method and Description |
---|---|
static void |
cycles2RelativeTime(long cycles,
RelativeTime relTime)
Convert a number of CPU cycles into a RelativeTime value.
|
static long |
getAccurateCpuTime(Thread t)
get high resolution Java execution time of a given thread.
|
static RelativeTime |
getAccurateCpuTime(Thread t,
RelativeTime time)
This method retrieves the current CPU time that was consumed by the given
thread and stores it into the given relativeTime-object.
|
static long |
getCpuTime(Thread t)
Deprecated.
|
static long |
getRawCpuTime()
get raw high resolution time.
|
static long |
getTotalCpuTime(Thread t)
get high resolution total execution time of given thread.
|
static boolean |
isAccurate()
This functions returns true iff for the given system, accurate
CPU cost monitoring is possible.
|
static long |
relativeTime2Cycles(RelativeTime relTime)
Convert a positive relative time to a CPU cycles value if the the CPU
usage monitoring is supported.
|
public static final boolean CPU_TIME_SUPPORTED
public static final long CPU_RATE
public static boolean isAccurate()
public static long getAccurateCpuTime(Thread t)
t
- the Java thread for which the execution time is to be
returned.public static RelativeTime getAccurateCpuTime(Thread t, RelativeTime time)
t
- the thread whose current CPU time ought to be retrievedtime
- (out!) the relativeTime-object for storing t's current
CPU time@Deprecated public static long getCpuTime(Thread t)
t
- the Java thread for which the execution time is to be
returned.public static long getTotalCpuTime(Thread t)
t
- the Java thread for which the execution time is to be
returned.public static long getRawCpuTime()
public static void cycles2RelativeTime(long cycles, RelativeTime relTime)
cycles
- number of CPU cycles, must be >= 0.relTime
- (out!) will be set to the time interval that
corresponds to the given number of cycles, a zero interval will be set in
case the CPU usage monitoring is not supported.public static long relativeTime2Cycles(RelativeTime relTime)
relTime
- a positive relative time, must not be null.aicas GmbH, Karlsruhe, Germany —www.aicas.com
Copyright © 2001-2022 aicas GmbH. All Rights Reserved.