osxcross/tools/cpucount.cpp
Jeroen T. Vermeulen d3961b8ed4 Replace cpucount.c with cpucount.cpp.
Uses a new function in C++11.  Avoids platform-specific code.
2016-09-22 19:01:58 +02:00

12 lines
198 B
C++

#include <iostream>
#include <thread>
/** Print number of (enabled) CPU cores.
*
* Requires C++11 or better.
*/
int main()
{
std::cout << std::thread::hardware_concurrency() << std::endl;
}