Skip to main content
GameDev.net gamedev.net
🔒 Locked

Getting CPU Usage

Started by Telamon Dec 28, 2003 at 9:47 PM 4 replies 1k views
Original Post
Telamon
Telamon
Hey, does anyone know how to get the current CPU usage and memory usage of a currently running program? I want to have my game server be able to have a little window that shows what percent of the CPU it is using and other handy statistics. The server uses DirectPlay, so it runs on more than one thread. I''m looking for a way to get application-wide statistics on this (as opposed to getting the CPU usage of the currently running thread). I basically want to duplicate the statistics the windows Task Manager will give you on any running program. I''m programming in C# (if there''s a .Net specific way to do it, I''d probably perfer that, as it is cleaner than the WINAPI) I used to know how to do this. Even just the name of the API call would be enough for me to figure it out. Thanks! ---------------------------------------- Let be be finale of seem, seems to me. ---------------------------------------- Coding: http://www.stanford.edu/~jjshed/coding Miscellany: http://www.stanford.edu/~jjshed
Telamon
Telamon
*bump*

I''ven''t been able to figure out how to do it yet, and the problem has come up again in another project. Can anyone help?
matias suarez
matias suarez
regular calls to GetThreadTimes is one way of doing it

-Mat

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.