Created
September 24, 2017 23:11
-
-
Save tilaklodha/0ebfff3357d24e094ea20cb53d31f657 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" | |
) | |
func printnumbers() { | |
for i := 1; i <= 5; i++ { | |
time.Sleep(250 * time.Millisecond) | |
fmt.Printf("%d ", i) | |
} | |
} | |
func printletters() { | |
for i := 'a'; i <= 'e'; i++ { | |
time.Sleep(400 * time.Millisecond) | |
fmt.Printf("%c ", i) | |
} | |
} | |
func main() { | |
go printnumbers() | |
go printletters() | |
time.Sleep(5000 * time.Millisecond) | |
fmt.Println("Printing from main") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment