When I measure the run time of my Go program with Linux's time
utility, I get the following output:
real 1m9.177s
user 7m1.788s
sys 0m39.016s
When I look at the output of the same exact program execution in Go's pprof CPU profiler, I get the following output:
Entering interactive mode (type "help" for commands)
(pprof) top
143.32s of 176s total (81.43%)
Where is the pprof getting this 176s figure from? It is neither the clock time nor the CPU time. I am running this program with GOMAXPROCS
set to 8, and I have a feeling this has something to do with it. How exactly does pprof measure run time, and why is it different from linux's time
?