How to get %CPU usage of a process
I'm working on a client server application and i've a feature to calculate CPU utilization of server and display on client GUI panel. My server is running on Mono on SUSE linux.
I know there have been similar threads open before for %CPU usage, but since there has been no discussion on them since 2003, i've started a new thread. I'm trying to find Peak CPU usage and average CPU usage of a process my server is running on. I also want to do it programmatically and not from command line.
I've implemented a similar feature for windows using System.Management API in C#.NET. But Mono doesn't support System.Management API yet. Is there a way i can calculate CPU usage of a process programatically on linux.