mirror of
https://github.com/Relintai/osxcross.git
synced 2025-02-03 22:45:56 +01:00
d3961b8ed4
Uses a new function in C++11. Avoids platform-specific code.
12 lines
198 B
C++
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;
|
|
}
|