github.com/sdboyer/gps@v0.16.3/_testdata/cmd/echosleep.go (about)

     1  package main
     2  
     3  import (
     4  	"flag"
     5  	"fmt"
     6  	"time"
     7  )
     8  
     9  func main() {
    10  	n := flag.Int("n", 1, "number of iterations before stopping")
    11  	flag.Parse()
    12  
    13  	for i := 0; i < *n; i++ {
    14  		fmt.Println("foo")
    15  		time.Sleep(time.Duration(i) * 250 * time.Millisecond)
    16  	}
    17  }