You've already forked go-profiler-notes
mirror of
https://github.com/DataDog/go-profiler-notes.git
synced 2025-07-15 23:54:16 +02:00
28 lines
285 B
Go
28 lines
285 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
"runtime/trace"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
trace.Start(os.Stdout)
|
|
defer trace.Stop()
|
|
|
|
go b()
|
|
a()
|
|
}
|
|
|
|
func a() {
|
|
start := time.Now()
|
|
for time.Since(start) < time.Second {
|
|
}
|
|
}
|
|
|
|
func b() {
|
|
start := time.Now()
|
|
for time.Since(start) < time.Second {
|
|
}
|
|
}
|