如何使用Windows API从C ++获取应用程序的CPU使用率或磁盘使用率? [英] How to get CPU usage or disk usage of application using Windows API from C++?

查看:473
本文介绍了如何使用Windows API从C ++获取应用程序的CPU使用率或磁盘使用率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何继续使用C ++中的API来获取应用程序的CPU使用率或磁盘使用率??

How to proceed to get CPU usage or disk usage of application using API in C++???

我希望获得最高的CPU使用率或磁盘使用率在Windows上运行的应用程序。
我试图找出API,但是没有直接的API。任何人都可以让我知道如何在C ++中进行此操作。

I want to get the highest CPU usage or disk usage among the application running on windows. I have tried to find out API but there is no direct API for that. Can anyone please let me know how to proceed for this in C++.

推荐答案

您可以查看Process类别性能计数器来获取处理CPU /内存/ IO或相应类别(处理器,内存,物理/逻辑磁盘)的计数器,以提高整体系统性能。可以通过专用API 来访问这些值,或者来自 WMI

You look at the Process category performance counters to get per process CPU/Memory/IO or at respective categories (Processor, Memory, Physical/Logical Disk) counters for overall system performance. The values can be accessed via dedicated APIs or from WMI.

这篇关于如何使用Windows API从C ++获取应用程序的CPU使用率或磁盘使用率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆