Good people, the problem is the following, I developed a code to get the percentage used by my application of the processor cores:
private String getCPULoad() {
OperatingSystemMXBean osBean = (OperatingSystemMXBean) ManagementFactory.getOperatingSystemMXBean();
DecimalFormat df = new DecimalFormat("#.##");
return (df.format(osBean.getProcessCpuLoad())) + "%";
}
In theory, he should give me back the percentage, well he returns, but in the wrong way, for example: when all cores are used 100%, he should give me the percentage "100%", but Instead he gives me 0.1%, could anyone tell me what I'm doing wrong?