Last active
September 1, 2018 08:12
-
-
Save berkant/205aefe08a29113e8b605ab57d1caa84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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