How can I get Windows data like CPU usage, etc.?

瘦欲@ 提交于 2019-12-21 02:30:23

问题


How can I get Windows data like CPU usage, physical memory, and network utilization and bandwidth, similar to what I see in Task Manager? I'm using C++.


回答1:


You can get CPU usage using the performance data. If you want data for only one (or a few processes) it may be simpler to call GetProcessTimes every few seconds.

It's generally difficult to pin down exactly what physical memory usage even means. Until you do, trying to describe how to measure it is pretty pointless.

You can get some information about network utilization with GetIpStatistics.

You can get the rated bandwidths of the installed network adapters with GetIfTable.




回答2:


Look Performance Counters in msdn



来源:https://stackoverflow.com/questions/10844631/how-can-i-get-windows-data-like-cpu-usage-etc

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