Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <thread>
- // main function
- // entry point to the application
- int main() {
- #ifdef __APPLE__
- std::cout << "This is a Mac running a darwin based system" << std::endl;
- #endif
- #ifdef __WIN32__
- std::cout << "This is a PC running a 32 or 64-bit version of Windows" << std::endl;
- #endif
- #ifdef __WIN64__
- std::cout << "This is a PC running a 64-bit version of Windows" << std::endl;
- #endif
- #ifdef __linux__
- std::cout << "This is a PC running Linux" << std::endl;
- #endif
- // a standard function to get the number of available threads
- unsigned int n = std::thread::hardware_concurrency();
- // printing out the number of threads to the standard output
- std::cout << n << " concurrent threads are supported.\n";
- // normal run returns zero
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement