GetCPUCores
Gib mir die Anzahl der CPU-Kerne:
- getCPUCores.c
#include <stdio.h>
#include <unistd.h>
//----------------------------------------------
int GetCores(void)
{
return sysconf( _SC_NPROCESSORS_ONLN );
}
//----------------------------------------------
void main(void)
{
printf ("Cores: %d \n",GetCores());
return;
}
//----------------------------------------------