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
Golang program for implementation of Radix Sort
This sample program demonstrates how to decode a JSON string.
How do you handle HTTP Client server load balancing in Go?
GO Program to Find the Largest Number Among Three Numbers
Golang program for implementation of Median of Medians
GO Program to Find Factorial of a Number
GO Program to print full Pyramid using *
How to read current directory using Readdir?
Add Method to Struct Type
Convert Float32 to Float64 and Float64 to Float32