aboutsummaryrefslogtreecommitdiff
path: root/src/threading/cpu.c
blob: 381abebb712f3588e8e8deb3aff29a4ff2571fa6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#ifdef _WIN32
#include <windows.h>
#else
#include <sys/sysinfo.h>
#endif

int get_core_count()
{
#ifdef _WIN32
    SYSTEM_INFO sysinfo;
    GetSystemInfo( &sysinfo );

    return sysinfo.dwNumberOfProcessors;
#else
    return get_nprocs();
#endif
}