Created
September 24, 2014 19:25
-
-
Save ciaranarcher/7f5c7c27f39f67772379 to your computer and use it in GitHub Desktop.
Print goroutines
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
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