Answers for "how get cpu cores in c++"

1

number of cores c++

#include <thread>

//may return 0 when not able to detect
const auto processor_count = std::thread::hardware_concurrency();
Posted by: Guest on June-07-2021

Browse Popular Code Answers by Language