Is there a simple way to find out the number of CPU's on a local machine using Go lang?
How to find out the number of CPUs in Go lang?
possible duplicate of Golang: how to verify number of processors on which a Go program is running –
Reverie
http://play.golang.org/p/cuaf2ZHLIx
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Println(runtime.NumCPU())
}
© 2022 - 2024 — McMap. All rights reserved.