Is there a simple way to find out the number of CPU's on a local machine using Go lang?
question from:https://stackoverflow.com/questions/24073697/how-to-find-out-the-number-of-cpus-in-go-langIs there a simple way to find out the number of CPU's on a local machine using Go lang?
question from:https://stackoverflow.com/questions/24073697/how-to-find-out-the-number-of-cpus-in-go-langhttp://play.golang.org/p/cuaf2ZHLIx
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Println(runtime.NumCPU())
}