golang-exercises/golangr/goroutines/main.go

19 lines
209 B
Go
Raw Normal View History

2024-02-26 11:59:46 +01:00
package main
import (
"fmt"
"time"
)
func printText(s string) {
for i := 0; i < 10; i++ {
time.Sleep(time.Millisecond * 50)
fmt.Println(s)
}
}
func main() {
go printText("FOO")
printText("BAR")
}