public class CpuTimeRunnableOperation extends SimpleMonitorableOperation implements Runnable
Runnable that maintains a CPU time counter for elapsed time evaluation.
The CPU time is stored in nanoseconds.
Note: Not thread-safe. It is recommended to create separate instances for each thread. If multiple threads access the same instance of this class, the metrics may be inconsistent.
counter| Constructor and Description |
|---|
CpuTimeRunnableOperation(Runnable targetRunnable)
Builds this monitorable operation with a given
Runnable to be profiled using
CPU time. |
| Modifier and Type | Method and Description |
|---|---|
void |
run()
See
Runnable.run(). |
elapsedTime, getCounterpublic void run()
Runnable.run().Copyright © 2019. All rights reserved.