zl程序教程

您现在的位置是:首页 >  其他

当前栏目

[Go] golang设置运行的cpu数

2023-02-18 15:41:33 时间
package main
import(
	"fmt"
	"runtime"
)
func main() {
	cpuNum:=runtime.NumCPU()
	fmt.Println("cpuNum=",cpuNum)
	runtime.GOMAXPROCS(cpuNum)
}