Created
April 28, 2019 12:19
-
-
Save topaztee/0db3540842d0751da8d1d8d2519d1a68 to your computer and use it in GitHub Desktop.
go run main.go && go tool trace trace.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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