Created
June 26, 2017 10:55
-
-
Save zhangyuchi/bbf9b556470cfce75aa43019ec97d4c2 to your computer and use it in GitHub Desktop.
获取cpu核心数
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
int main(){ | |
return static_cast<int>(sysconf(_SC_NPROCESSORS_ONLN)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment