go-profiler-notes/guide/cpu-utilization.go
2021-09-09 23:46:41 +02:00

24 lines
237 B
Go

// +build ignore
package main
import (
"os"
"runtime/pprof"
"time"
)
func main() {
pprof.StartCPUProfile(os.Stdout)
defer pprof.StopCPUProfile()
go cpuHog()
go cpuHog()
time.Sleep(time.Second)
}
func cpuHog() {
for {
}
}