Monitor CPU and memory consumption of a specific processes in (Windows) C?

为君一笑 提交于 2019-12-24 01:25:10

问题


i would like to monitor the cpu and memory consumption of a given process in windows (nt architecture - xp,vista,win7), every few seconds to make a graph i have searched around but found only non C solutions only (java,c#,c++, etc) i know there is a PerformanceCounter class, but obviously it is not available in c.

thanks


回答1:


Win32 Performance Counters:

http://msdn.microsoft.com/en-us/library/aa373083%28v=vs.85%29.aspx

Developer Audience:

Performance Counters is designed for use by C and C++ developers.

However, If you just want a tool to show you this information, get Mark Russinovich's Process Explorer. It can show per-process stats and graphs.



来源:https://stackoverflow.com/questions/6664257/monitor-cpu-and-memory-consumption-of-a-specific-processes-in-windows-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!