2017-09-27 04:08:09 -07:00

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)
}