assertGtEqZeroTrace("Sys", cpu.getSys());
assertGtEqZeroTrace("Total", cpu.getTotal());
CpuTimer timer = new CpuTimer(sigar);
timer.start();
for (int i=0; i<1000000; i++) {
System.getProperty("java.home");
}
String sleepTime =
System.getProperty("sigar.testThreadCpu.sleep");
if (sleepTime != null) {
Thread.sleep(Integer.parseInt(sleepTime) * 1000);
}
timer.stop();
traceln("\nUsage...\n");
assertGtEqZeroTrace("User", timer.getCpuUser());
assertGtEqZeroTrace("Sys", timer.getCpuSys());
assertGtEqZeroTrace("Total", timer.getCpuTotal());
assertGtEqZeroTrace("Real Time", timer.getTotalTime());
traceln("Cpu Percent=" + CpuPerc.format(timer.getCpuUsage()));
}