public class CpuTicks extends Object
Constructor and Description |
---|
CpuTicks(oshi.hardware.CentralProcessor processor,
long waitingTime)
构造,等待时间为用于计算在一定时长内的CPU负载情况,如传入1000表示最近1秒的负载情况
|
Modifier and Type | Method and Description |
---|---|
long |
getcSys() |
long |
getIdle() |
long |
getIoWait() |
long |
getIrq() |
long |
getNice() |
long |
getSoftIrq() |
long |
getSteal() |
long |
getUser() |
void |
setcSys(long cSys) |
void |
setIdle(long idle) |
void |
setIoWait(long ioWait) |
void |
setIrq(long irq) |
void |
setNice(long nice) |
void |
setSoftIrq(long softIrq) |
void |
setSteal(long steal) |
void |
setUser(long user) |
String |
toString() |
long |
totalCpu()
获取CPU总的使用率
|
public CpuTicks(oshi.hardware.CentralProcessor processor, long waitingTime)
processor
- CentralProcessor
waitingTime
- 设置等待时间,单位毫秒public long getIdle()
public void setIdle(long idle)
public long getNice()
public void setNice(long nice)
public long getIrq()
public void setIrq(long irq)
public long getSoftIrq()
public void setSoftIrq(long softIrq)
public long getSteal()
public void setSteal(long steal)
public long getcSys()
public void setcSys(long cSys)
public long getUser()
public void setUser(long user)
public long getIoWait()
public void setIoWait(long ioWait)
public long totalCpu()
Copyright © 2024. All rights reserved.