LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 09-04-2008, 10:32 AM   #1
tech_usr
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
CPU & memory usage


Hi,

I'ld like to gather CPU & memory usage while a program is executing and print out a report. Does linux support any functions to track system usage statistics that I can use in the C++ program?
On a side note, does C++ have any such APIs?

Thanks in advance...
 
Old 09-04-2008, 11:58 AM   #2
normscherer
Member
 
Registered: Sep 2005
Location: On the road
Distribution: Ubuntu 8.10
Posts: 40

Rep: Reputation: 15
You might get what you want from /usr/bin/time --verbose

time is a shell builtin with much simpler output so use /usr/bin/time

This will give you the stats when the program exits. If you want info while the program is executing take a look at ps and all of its options.

Last edited by normscherer; 09-04-2008 at 12:00 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can we monitor CPU & Memory usage of Windows boxes through RRDtool on Linux (RHEL 3)? sandeepgupte Linux - Software 1 09-19-2007 11:35 AM
getting realtime info on memory usage-cpu and harddrive usage steering Linux - Newbie 5 03-03-2005 09:43 PM
CPU and memory usage suguname Linux - Newbie 3 02-01-2005 02:45 PM
how to determine cpu usage, memory usage, I/O usage by a particular user logged on li rags2k Programming 4 08-21-2004 05:45 AM
Controlling CPU usage & memory usage Saravana babu Linux - Software 0 02-18-2004 06:55 AM


All times are GMT -5. The time now is 09:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration