Skip to content

Instantly share code, notes, and snippets.

@hackintoshrao
Created January 15, 2016 04:38
Show Gist options
  • Save hackintoshrao/8bf3044a7b64ba18ae43 to your computer and use it in GitHub Desktop.
Save hackintoshrao/8bf3044a7b64ba18ae43 to your computer and use it in GitHub Desktop.
The Synchronization challenge
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