سؤال

want to know the usage percentage used by each CPU on my machine. is there a code java or a windows cmd command allows to me to know this information? please help me if you can. thanks.

هل كانت مفيدة؟

المحلول 2

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

نصائح أخرى

There is a nice MX bean for this:

OperatingSystemMXBean.getSystemLoadAverage()

that gets the overall load average. You can then divide this by the number of CPUs for the average per-CPU load.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top