remove number for source

This commit is contained in:
Mark McGranaghan
2012-10-07 02:00:54 -04:00
parent beaad143c4
commit 2c4dea2b8e
134 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
// ## Concurrent Goroutines
package main
import "time"
import "math/rand"
import "fmt"
func f(n int) {
for i := 0; i < 10; i++ {
fmt.Println(n, ":", i)
breakTime := time.Duration(rand.Intn(150))
time.Sleep(time.Millisecond * breakTime)
}
}
func main() {
for i := 0; i < 5; i++ {
f(i)
}
fmt.Println()
for i := 0; i < 5; i++ {
go f(i)
}
var input string
fmt.Scanln(&input)
}