If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Process CPU/Mem Usage

Hi all,

I am writing a program that fuctions pretty much like the windows task manager. I am able to list all the running processes and get the pids.
The problem im having is when it comes to getting the cpu and memory usage of each process. I just cant find out how to get this information.

Process CPU / Mem usage

Hi,
I found this article once
( http://www.alexfedotov.com/samples/wmitop.asp )
I think it will help you, to understand how to calculate the CPU
usage. I also wrote a small (it's a laity one) program that shows
the CPU usage of the program itself. I hope this will help.
Note that my calculations are actually wrong, because i only use
the Low part of the DateTime structure. Normally and correctly
one should use the structure as a 64-bit Value. For more
information look in MSDN ( GetProcessTime)

Regards,
typecast aka Pavel

source code of the program:
( i use default names. one form with one timer and one label)

Cheers for that code, it took me a while but i finaly got it working.
Only problem i have now is i dont know how to work with the two 32 bit numbers. How do i get the correct value out of them in that calculation?