20 lines
302 B
Go
20 lines
302 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
)
|
|
|
|
func delay_string(str string) {
|
|
time.Sleep(100 * time.Millisecond)
|
|
fmt.Println(str)
|
|
}
|
|
|
|
func main() {
|
|
go delay_string("world!")
|
|
fmt.Println("hello")
|
|
// Added to avoid the program ending before the routine finished
|
|
time.Sleep(100 * time.Millisecond * 2)
|
|
|
|
}
|