hello world for concurrency
This commit is contained in:
parent
a3f6157543
commit
c45dcc9178
18
concurrency/hello/go.go
Normal file
18
concurrency/hello/go.go
Normal file
@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
|
||||
func say(s string) {
|
||||
for i := 0; i < 5; i++ {
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
fmt.Print(s)
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
go say("world!!\n")
|
||||
say("hello ")
|
||||
}
|
Loading…
Reference in New Issue
Block a user