如何使用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.