Skip to content

Instantly share code, notes, and snippets.

@thomaspoignant
Created January 22, 2021 17:55
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 thomaspoignant/31614124032621b8838509fa54b93224 to your computer and use it in GitHub Desktop.
Save thomaspoignant/31614124032621b8838509fa54b93224 to your computer and use it in GitHub Desktop.
ticker = time.NewTicker(3 * time.Second)
defer ticker.Stop() // stop the ticker
//...
case <- ticker.C:
// update cache
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment