cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
UNIX/Linux Programming
API / function for checking CPU usage by
API / function for checking CPU usage by a process
Mar 31, 2010 at 6:25pm UTC
vvadan
(36)
what is the API / function for getting the percentage of CPU utilisation by a given process?
Apr 2, 2010 at 8:25pm UTC
Rambetter
(8)
man 2 getrusage
This C function will give you a lot of information including the total user CPU time used by your process. You can calculate how much it's using currently by observing a change in this value over time.
Topic archived. No new replies allowed.