1

I am creating a program in java which runs another program in java.

Runtime.getRuntime().exec("java process1");

I want to get the CPU usage of this process.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
  • 1
    Possible duplicate? http://stackoverflow.com/questions/7359245/what-is-the-right-command-line-to-get-cpu-usage-for-certain-process-in-java?rq=1 – R Hughes Nov 30 '13 at 18:56
  • I didn't find the answer that I need, from this link – user3023307 Dec 01 '13 at 00:09
  • If you're running linux create a script that does `time java process1`, run that from your parent and parse the output from the `time` command in your parent. – Andy Brown Oct 23 '15 at 08:15

0 Answers0