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
Program to print pyramid using numbers
Database as a Service (DBaaS): Simplifying Database Management in the Cloud
GO Program to find area and circumference of circle
Web Application to generate QR code in Golang
How do you send an HTTP PUT request in Go?
How to convert String to Boolean Data Type Conversion in Go?