func NumCPU() (int, error) {
	cpuInfos, err := cpu.Info()
	if err != nil {
		return 0, err
	}
	var count int32
	for _, inf := range cpuInfos {
		count += inf.Cores
	}
	return int(count), nil
}
// NumCPU returns the count of CPUs in the CPU affinity mask of the pid 1 process
NumCPU returns the count of CPUs in the CPU affinity mask of the pid 1 process
// NumCPU returns the count of CPUs in the CPU affinity mask of the pid 1 process
func NumCPU() (int, error) {
	cpuInfos, err := cpu.Info()
	if err != nil {
		return 0, err
	}
	var count int32
	for _, inf := range cpuInfos {
		count += inf.Cores
	}
	return int(count), nil
}
func NumCPU ( ) ( int , error ) { cpuInfos , err := cpu . Info ( ) if err != nil { return 0 , err } var count int32 for _ , inf := range cpuInfos { count += inf . Cores } return int ( count ) , nil }
NumCPU returns the count of CPUs in the CPU affinity mask of the pid 1 process
NumCPU returns the count of CPUs in the CPU affinity mask of the pid 1 process