Skip to content

Instantly share code, notes, and snippets.

@gerep
Created February 28, 2016 13:07
Show Gist options
  • Save gerep/cff75b86335ea178bb60 to your computer and use it in GitHub Desktop.
Save gerep/cff75b86335ea178bb60 to your computer and use it in GitHub Desktop.
Heartbeat example
package main
import (
"fmt"
"time"
)
func main() {
heartbeat := time.Tick(1 * time.Second)
for {
select {
case <-heartbeat:
fmt.Println("Heartbeat")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment