Is there a simple way to find out the number of CPU's on a local machine using Go lang?
1 Answer
http://play.golang.org/p/cuaf2ZHLIx
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Println(runtime.NumCPU())
}
http://play.golang.org/p/cuaf2ZHLIx
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Println(runtime.NumCPU())
}