sdlGetCpuCount function

int sdlGetCpuCount()

Get the number of CPU cores available.

\returns the total number of logical CPU cores. On CPUs that include technologies such as hyperthreading, the number of logical cores may be more than the number of physical cores.

\since This function is available since SDL 2.0.0.

extern DECLSPEC int SDLCALL SDL_GetCPUCount(void)

Implementation

int sdlGetCpuCount() {
  final sdlGetCpuCountLookupFunction = libSdl2
      .lookupFunction<Int32 Function(), int Function()>('SDL_GetCPUCount');
  return sdlGetCpuCountLookupFunction();
}