mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-04 20:57:49 +00:00
18 lines
336 B
C++
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
|
|
}
|