Skip to content

Instantly share code, notes, and snippets.

@ciaranarcher
Created September 24, 2014 19:25
Show Gist options
  • Save ciaranarcher/7f5c7c27f39f67772379 to your computer and use it in GitHub Desktop.
Save ciaranarcher/7f5c7c27f39f67772379 to your computer and use it in GitHub Desktop.
Print goroutines
ticker := time.NewTicker(time.Second * 5)
go func() {
for _ = range ticker.C {
fmt.Printf("Goroutine count: %d\n", runtime.NumGoroutine())
}
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment