CPU, Memory usage of a process

Hi,

How can I retrieve the performance information
information of process during runtime ?

I know PSAPI can provide some information like memory.
But I want to know CPU information, just like
performance monitor, where CPU%, CPU time can be
shown.

Thanks in advance.

G.C.


Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/

Hello,

The WIN32 API function GetProcessTimes gives you the
CPU time spent by a process in user mode and kernel
mode. For finding the %CPU time, you probably have to
use native API function NtQuerySystemInformation with
information class 5. This returns you various
statistics about all the processes running in the
system. By performing arithmatic calculations on CPU
times of all the processes you can find out %CPU
usage.

-Prasad

— “G.C.” wrote:
> Hi,
>
> How can I retrieve the performance information
> information of process during runtime ?
>
> I know PSAPI can provide some information like
> memory.
> But I want to know CPU information, just like
> performance monitor, where CPU%, CPU time can be
> shown.
>
> Thanks in advance.
>
>
> G.C.
>
>
>
>
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo!
> Messenger.
> http://im.yahoo.com/
>
> —
> You are currently subscribed to ntdev as:
> xxxxx@yahoo.com
> To unsubscribe send a blank email to
> $subst(‘Email.Unsub’)
>

=====
Prasad S. Dabak
Director of Engineering, Windows NT/2000 Division
Cybermedia Software Private Limited
http://www.cybermedia.co.in
Co-author of the book “Undocumented Windows NT”
ISBN 0764545698


Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/