go-profiler-notes/docs/code/cpu-profiler-start-stop.go
Felix Geisendörfer 6342fc3259 updates
2022-12-29 14:05:20 +01:00

14 lines
180 B
Go

//go:build ignore
package main
import (
"os"
"runtime/pprof"
)
func main() {
file, _ := os.Create("./cpu.pprof")
pprof.StartCPUProfile(file)
defer pprof.StopCPUProfile()
}