Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import (
"fmt"
"time"
"runtime"
)
func printTime() {
for i := 0; i < 5; i++ {
time.Sleep(time.Millisecond)
fmt.Println(time.Now())
}
}
func main() {
runtime.GOMAXPROCS(1)
go printTime()
printTime()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment