C语言在liunx系统下获取cpu核心数

#include <stdio.h>
#include <sys/sysinfo.h>

void main(int argc, char *argv[])
{
    printf("This system has %d processors\n",
        get_nprocs_conf());
    
}

猜你喜欢

转载自blog.csdn.net/qq_30117591/article/details/82936640