[代码完善](master): 代码优化

pull/789/head
Zheng Jie 2022-06-14 16:15:49 +08:00
parent eadd9c7746
commit c9f10579bf
1 changed files with 2 additions and 2 deletions

View File

@ -148,8 +148,8 @@ public class MonitorServiceImpl implements MonitorService {
cpuInfo.put("logic", processor.getLogicalProcessorCount() + "个逻辑CPU");
// CPU信息
long[] prevTicks = processor.getSystemCpuLoadTicks();
// 等待300毫秒...
Util.sleep(300);
// 等待500毫秒...
Util.sleep(500);
long[] ticks = processor.getSystemCpuLoadTicks();
long user = ticks[CentralProcessor.TickType.USER.getIndex()] - prevTicks[CentralProcessor.TickType.USER.getIndex()];
long nice = ticks[CentralProcessor.TickType.NICE.getIndex()] - prevTicks[CentralProcessor.TickType.NICE.getIndex()];