pprof有两个包: net/http/pprof runtime/pprof 其实net/http/pprof中只是使用runtime/pprof包来进行封装了一下,并在http端口上暴露出来 实例 package main import ( log net net/http time ) func run() { http.ListenAndServe(:7773, nil) return } func main() { go run() go func() { for { fmt.Println(running...) time