windows:
使用的库是:pdh.h
Pdh.h header - Win32 apps | Microsoft Docshttps://docs.microsoft.com/zh-cn/windows/win32/api/pdh/打印硬件信息:
jeffcharles/batarim-utilization-logger: This application will log various utilization statistics (e.g., overall CPU and RAM usage) into a CSV file along with what applications were using the most CPU and RAM at a given time and what window was focused. This CSV file can then be analyzed to determine if there are any problems with resource utilization levels, if any applications are stressing the hardware, or for any other purpose that you would like. (github.com)https://github.com/jeffcharles/batarim-utilization-loggerScuroGuardiano/ServerUsageMonitor: Server Usage Monitor for Windows. You can see actual usage CPU, RAM and Virtual Memory on the page. (github.com)https://github.com/ScuroGuardiano/ServerUsageMonitor
结论:与任务管理器对比,CPU不准,内存较准