1
0
Fork 0
mirror of https://github.com/vbatts/talks.git synced 2025-05-22 21:02:30 +00:00

2013-03: adding an old learning lunch

This commit is contained in:
Vincent Batts 2016-12-05 10:44:45 -05:00
parent 68f582d393
commit 24cea0199b
17 changed files with 718 additions and 0 deletions

View file

@ -0,0 +1,30 @@
package main
import (
"fmt"
"time"
)
// START OMIT
func DelayedHello() {
time.Sleep(3 * time.Second)
fmt.Printf("%d: Hello!\n", time.Now().Unix())
}
func main() {
go DelayedHello()
go DelayedHello()
go func() {
time.Sleep(3 * time.Second)
fmt.Printf("%d: Hello!\n", time.Now().Unix())
}()
fmt.Printf("%d: Is there anybody in there?!\n", time.Now().Unix())
for i := 0; i < 5; i++ {
fmt.Printf("%d: .\n", time.Now().Unix())
time.Sleep(time.Second)
}
}
// STOP OMIT