Find out how many logical processors used by current process
NumCPU returns the number of logical CPUs usable by the current process.
Example
package main
import (
"fmt"
"runtime"
)
func main() {
fmt.Println(runtime.NumCPU())
}
Most Helpful This Week
Convert Float32 to Float64 and Float64 to Float32
How do you handle HTTP server HTTP/2 in Go?
Program in Go language to Calculate Standard Deviation using Math package
Interface embedding another interface in Go Programming Language
Golang program for implementation of Linked List
Golang program for implementation of Tower of Hanoi Algorithm