I have a C++ app called ./blah (to which I have the source code)
when I run ./blah
I can run "top" and see how much memory & cpu "./blah" is using.
Now, is there anyway for "./blah" to access that information itself? I.e. when I run ./blah, I want it to every second dump out it's CPU & Memory usage. What library should I be using to do this?
I'm on MacOSX; but I'd prefer a solution that works on Linux too.
Thanks!