Created
October 24, 2018 23:48
-
-
Save seanhagen/7488b058debcc01776a5bff941090358 to your computer and use it in GitHub Desktop.
Profiling code
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
// p := profile.Start(profile.CPUProfile, profile.ProfilePath("/tmp/prof"), profile.NoShutdownHook) | |
p := profile.Start(profile.MemProfile, profile.ProfilePath("/tmp/prof"), profile.NoShutdownHook) | |
time.AfterFunc(time.Minute, func() { | |
fmt.Printf("1 minute until profiling stopped\n") | |
}) | |
time.AfterFunc(time.Minute*2, func() { | |
fmt.Printf("stopping profiling\n") | |
p.Stop() | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment