问题
Given a process ID, what is the right command to get the current cpu usage from the process, in Java.
The command typeperf "\Memory\Available bytes" "\processor(_total)\% processor time" is not for a specific process, and any 3rd party utility is not a option, ProcDump alike. Thanks for any pointers!
回答1:
Try http://support.hyperic.com/display/SIGAR/Home
Otherwise look at How can a Java program get its own process ID?
来源:https://stackoverflow.com/questions/7359245/what-is-the-right-command-line-to-get-cpu-usage-for-certain-process-in-java