Last active
May 7, 2019 02:30
-
-
Save o0-o/5a080bcbe5457bc09e3b58f4026c1d1d to your computer and use it in GitHub Desktop.
[Number Threads] Prints the number of processing threads #Shell
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
# cpu_threads.sh | |
( # linux | |
getconf _NPROCESSORS_ONLN || | |
# bsd | |
sysctl -n hw.ncpu | |
) 2>/dev/null || | |
exit 1 #failture | |
exit 0 #success |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment