tick a function every `time.Duration` for Golang