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
Initial work on new guide
This commit is contained in:
27
examples/guide/main2.go
Normal file
27
examples/guide/main2.go
Normal file
@ -0,0 +1,27 @@
|
||||
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 {
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user