Created
January 15, 2016 04:38
-
-
Save hackintoshrao/8bf3044a7b64ba18ae43 to your computer and use it in GitHub Desktop.
The Synchronization challenge
This file contains 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" | |
) | |
func main() { | |
go my_func() | |
for i := 0; i < 10; i++ { | |
fmt.Println("in the main function ") | |
} | |
time.Sleep(1 * time.Second) | |
} | |
func my_func() { | |
for i := 0; i < 10; i++ { | |
time.Sleep(1 * time.Millisecond) | |
fmt.Println("In the Go routine ") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment