Re: CPU usage of particular process

2013-05-24 Thread neha naik
Does your machine have multiple CPUs? Regards, Neha On Mon, May 20, 2013 at 4:05 AM, Rahul Bedarkar rpal...@gmail.com wrote: Hi, I am trying to write small program to get CPU usage for a particular process. My logic is to read user, nice, system, idle values from /proc/stat. Then read user

CPU usage of particular process

2013-05-20 Thread Rahul Bedarkar
Hi, I am trying to write small program to get CPU usage for a particular process. My logic is to read user, nice, system, idle values from /proc/stat. Then read user and system time from /proc/pid/stat. Then wait for some time and again read same values. After that I am doing following