【转】用golang程序跑满cpu
原文: https://www.jianshu.com/p/f453a271179a
-------------------------
用golang程序跑满cpu
test.go
package main
func test_print(a int) {
for {
}
}
hello.go
package main
import "time"
func main() {
for i := 0; i < 100; i++ {
go test_print(i)
}
time.Sleep(100*time.Second)
}