aviit
aviit

Reputation: 2109

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

Upvotes: 5

Views: 7505

Answers (2)

RolandXu
RolandXu

Reputation: 3678

Look Performance Counters in msdn

Upvotes: 2

Jerry Coffin
Jerry Coffin

Reputation: 490178

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.

Upvotes: 7

Related Questions