public class CpuTimes extends Object
| Constructor and Description |
|---|
CpuTimes(long userMillis,
long systemMillis,
long idleMillis) |
| Modifier and Type | Method and Description |
|---|---|
float |
getCpuUsage(CpuTimes previous)
Gets the CPU usage given a previous snapshot of CPU times.
|
long |
getIdleMillis()
The total time in milliseconds that the CPUs have spent idle.
|
long |
getSystemMillis()
The total time in milliseconds that the CPUs have spent in kernel mode.
|
long |
getTotalMillis()
The total time in milliseconds that the CPUs have been alive since the system
was last booted.
|
long |
getUserMillis()
The total time in milliseconds that the CPUs have spent in user mode.
|
public long getUserMillis()
public long getSystemMillis()
public long getIdleMillis()
public long getTotalMillis()
public float getCpuUsage(CpuTimes previous)
previous - a CpuTimes snapshot taken previously.Copyright © 2009 ThoughtWorks. All Rights Reserved.