【Windows系统】C++方式获取CPU个数

  • Post author:
  • Post category:其他


废话不多说,直接上代码

#include <windows.h>

int get_cpu_cnt()
{
    SYSTEM_INFO si;
    GetSystemInfo(&si);

    return si.dwNumberOfProcessors;
}



版权声明:本文为u013001137原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。