Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@arschles
Last active October 17, 2016 20:02
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 arschles/5d608b1e0d2f419af0ccdc7efe7e8f25 to your computer and use it in GitHub Desktop.
Save arschles/5d608b1e0d2f419af0ccdc7efe7e8f25 to your computer and use it in GitHub Desktop.
for/select loop for tickers & timers
i := 0
for {
select {
case <- timer.C:
return
case <-ticker.C:
fn(i)
i++
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment