Files
2025-09-18 17:55:52 -04:00

18 lines
336 B
C++

#include "CPUCount.h"
#if defined (_WIN32)
# include <thread>
#else
# include "rbx/SystemUtil.h"
#endif
unsigned int RbxTotalUsableCoreCount(unsigned int defaultValue)
{
#ifdef _WIN32
unsigned n = std::thread::hardware_concurrency();
return n ? n : defaultValue;
#else
return RBX::SystemUtil::getCPUCoreCount();
#endif
}