Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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++.

like image 944
aviit Avatar asked Jun 01 '12 04:06

aviit


People also ask

How do I monitor CPU and Memory usage windows?

Check Computer Memory Usage EasilyTo open up Resource Monitor, press Windows Key + R and type resmon into the search box. Resource Monitor will tell you exactly how much RAM is being used, what is using it, and allow you to sort the list of apps using it by several different categories.

How do I see CPU usage and Memory?

Check resource usage in Task ManagerCtrl + Shift + Escape. Ctrl + Alt + Delete, and then click Task Manager from the options presented.


1 Answers

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.

like image 91
Jerry Coffin Avatar answered Oct 02 '22 04:10

Jerry Coffin