Skip to content

Instantly share code, notes, and snippets.

@topaztee
Created April 28, 2019 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save topaztee/0db3540842d0751da8d1d8d2519d1a68 to your computer and use it in GitHub Desktop.
Save topaztee/0db3540842d0751da8d1d8d2519d1a68 to your computer and use it in GitHub Desktop.
go run main.go && go tool trace trace.out
package main
import (
"fmt"
"os"
"runtime/trace"
)
func main() {
f, err := os.Create("trace.out")
if err != nil {
panic(err)
}
defer f.Close()
err = trace.Start(f)
if err != nil {
panic(err)
}
defer trace.Stop()
fmt.Println("hello")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment