Skip to content

Instantly share code, notes, and snippets.

@gufranmirza
Created July 13, 2019 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gufranmirza/69f93c5b9941b0834ccdc32709e0060e to your computer and use it in GitHub Desktop.
Save gufranmirza/69f93c5b9941b0834ccdc32709e0060e to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
)
func numbers() {
for i := 1; i <= 5; i++ {
time.Sleep(250 * time.Millisecond)
fmt.Printf("%d ", i)
}
}
func alphabets() {
for i := 'a'; i <= 'e'; i++ {
time.Sleep(400 * time.Millisecond)
fmt.Printf("%c ", i)
}
}
func main() {
go numbers()
go alphabets()
time.Sleep(3000 * time.Millisecond)
fmt.Println("main terminated")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment