Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumGopprof basicsSingle-choice MCQ

Using `runtime/pprof`, you capture a CPU profile of a long-running job. Which statement correctly describes how a CPU profile is collected?

f, _ := os.Create("cpu.prof") pprof.StartCPUProfile(f) defer pprof.StopCPUProfile()