Guest User

Untitled

a guest
Jul 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "fmt"
  5. "time"
  6. )
  7.  
  8. func count(id int) {
  9. for i := 0; i < 10; i++ {
  10. fmt.Println(id, ":", "sheep")
  11.  
  12. time.Sleep(time.Millisecond * 1000)
  13. }
  14. }
  15.  
  16. func main() {
  17. for i := 0; i < 10; i++ {
  18. go count(i)
  19. time.Sleep(time.Millisecond * 11000)
  20. }
  21. }
Add Comment
Please, Sign In to add comment