Essential Go for, while loops  Edit on GitHub      File Issue

Timed loop

for _ = range time.Tick(time.Second * 3) {
	fmt.Println("Ticking every 3 seconds")
}

This is a range loop over a channel.

time.Tick returns a channel that will be signalled after a given timeout.

  ↑ ↓ to navigate     ↵ to select     Esc to close