http://play.golang.org/p/cuaf2ZHLIxpackage main import ( "fmt" "runtime" ) func main() { fmt.Println(runtime.NumCPU()) }