windows:
使用的库是:pdh.h
Pdh.h header - Win32 apps | Microsoft Docs
https://docs.microsoft.com/zh-cn/windows/win32/api/pdh/打印硬件信息:
C/C++获取操作系统、CPU、内存信息、硬盘、IP和MAC、进程信息(windows和linux)_All In !!!的博客-CSDN博客_c++ 获取处理器信息
https://blog.csdn.net/hwx802746/article/details/114281780打印CPU和内存实时使用信息:
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
Linux: