getting the cpu usage of a single process
this is the code to get the pids and %cpu n %mem
Code:
FILE *fp; if i give input -> pid of a process, how can i get the %cpu and mem of that process only?:confused: :scratch: can someone gimme the code to it?:rolleyes: thanks in advance :newbie: |
ps -eo pid,pcpu,pmem|grep <wanted_pid>
|
Quote:
hii that thing works when given at command prompt right? but it wont work like this:-- Code:
scanf("%d", pid); could yu correct it please? i want the user to give a pid as in input and the give him the %cpu and %mem as output... could yu please gimme the code...:confused: |
All times are GMT -5. The time now is 05:42 PM. |