go多进程
package main
import "fmt"
import "time"
func loop() {
for i := 0; i < 10; i++ {
//fmt.Printf("%d ", i)
}
}
func loop1() {
for i := 0; i < 10; i++ {
fmt.Printf("%d ", i*5)
}
}
func main() {
for i :=0; i<1000;i++{
go loop()
fmt.Printf("%d ", i)
}
loop1()
time.Sleep(time.Second) // 停顿一秒
}
posted on 2015-09-29 10:12 liuwenbohhh 阅读(281) 评论(0) 编辑 收藏 举报