Skip to content

Instantly share code, notes, and snippets.

@syossan27
Created December 18, 2017 08:27
Show Gist options
  • Select an option

  • Save syossan27/10f4db98e538120c539bb2d5582b1fe7 to your computer and use it in GitHub Desktop.

Select an option

Save syossan27/10f4db98e538120c539bb2d5582b1fe7 to your computer and use it in GitHub Desktop.
ticker := time.NewTicker(3 * time.Second)
stop := make(chan bool)
func (t *Termbox) RefreshRateDraw(ticker *time.Ticker, stop chan bool) {
for {
select {
case <-ticker.C:
t.UpdateData()
t.Draw()
case <-stop:
break
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment