// Chapter 36 example: three slow jobs, one after another. // Run with: go run exercises/36/01-one-after-another.go package main import ( "fmt" "time" ) // download pretends to fetch a file. time.Sleep stands in for the waiting. func download(name string) { fmt.Println("Start", name) time.Sleep(500 * time.Millisecond) fmt.Println("Done ", name) } func main() { start := time.Now() download("a.txt") download("b.txt") download("c.txt") fmt.Println("Took", time.Since(start).Round(100*time.Millisecond)) }