Newer
Older
01_hello / goroutine / goroutine.go
yhornisse on 3 Oct 2021 191 bytes add goroutine sample
package main

import (
	"fmt"
	"time"
)

func hoge() {
	for i := 0; i < 10; i++ {
		fmt.Println(i)
		time.Sleep(1 * time.Second)
	}
}

func main() {
	go hoge()
	time.Sleep(3 * time.Second)
}