Created
December 1, 2017 03:43
-
-
Save debnath/ff084e83d77dae8aafd737c6ca510958 to your computer and use it in GitHub Desktop.
Tracing Golang app execution
This file contains hidden or 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
f, err := os.Create("cpu.trace") | |
if err != nil { | |
panic(err) | |
} | |
trace.Start(f) | |
defer trace.Stop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
#!/bin/bash
binary="tes"
if [ -f $binary ] ; then
rm $binary
fi
go build -o tes
time ./tes