mirror of
https://github.com/copyrighttxt/watrbx-game-engine.git
synced 2026-09-05 05:07:48 +00:00
GEEKING
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#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
|
||||
}
|
||||
Reference in New Issue
Block a user