Skip to content

Instantly share code, notes, and snippets.

@hackintoshrao
Created January 15, 2016 03:19
Show Gist options
  • Save hackintoshrao/485cd6d53db44a634acf to your computer and use it in GitHub Desktop.
Save hackintoshrao/485cd6d53db44a634acf to your computer and use it in GitHub Desktop.
Code without any concurrent execution
package main
import (
"fmt"
"time"
)
func main() {
my_sleep_func()
fmt.Println("Control doesnt reach here till my_sleep_func finishes executing")
}
func my_sleep_func() {
//sleeps for 5 seconds
time.Sleep(5 * time.Second)
fmt.Println("My func out of sleep")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment