Hello,
There are some ways to do this.
For CPU monitoring (and network), you can look into a package called mrtg that can be setup to monitor CPU processes, and graph it out. It will require you to setup snmpd and other things in order to get it to function properly.
For code, and how much CPU you use, check out your compiler to see if it supports profiling. I did that for COBOL code on a VAX/VMS, and for C++ on my Macintosh. Found out what functions used the most CPU time, and how long it took to do them. I liked profiling sorts, and comparing quicksort vs. bubble sort and the like.
Now, I know it isn't cross-platform, but the profiling might be the most efficient and non-skewing of the techniques. Why? because it is built into the compiler environment, and I am sure that the program coders took that into account.
Christian
Reputation Points: 121
Solved Threads: 57
Posting Virtuoso
Offline 1,629 posts
since Mar 2004