go-profiler-notes/docs/profiling/cpu-profiler-start-stop.go
Felix Geisendörfer e27d754ed0 toc rework
2022-12-29 14:05:19 +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()
}