box-o-sand/oldstuff/gotime/gotour-artifacts/goroutines/main.go

19 lines
195 B
Go
Raw Normal View History

2012-10-23 22:32:24 +00:00
package main
import (
2012-11-06 02:00:35 +00:00
"fmt"
"time"
2012-10-23 22:32:24 +00:00
)
func say(s string) {
2012-11-06 02:00:35 +00:00
for i := 0; i < 5; i++ {
time.Sleep(100 * time.Millisecond)
fmt.Println(s)
}
2012-10-23 22:32:24 +00:00
}
func main() {
2012-11-06 02:00:35 +00:00
go say("world")
say("hello")
2012-10-23 22:32:24 +00:00
}