javacpu-usagejmx

Percentage usage by each processor in my machine


I want to know the usage percentage used by each CPU on my machine. Is there a Java code or a Windows command to allow me to know this information?


Solution

  • Take a look at Sigar. The getCpuPercList method in the Sigar class will give you usage stats on each core.