package main import ( "log" "sync" "../.." ) func main() { scheduler := gocron.NewTimerWheel(nil) var wg sync.WaitGroup wg.Add(61) secondCount := 1 scheduler.Every(1).Second().Do(func() { log.Printf("%d second", secondCount) secondCount++ wg.Done() }) scheduler.Every(1).Minute().Do(func() { log.Printf("%d minute", secondCount/60) wg.Done() }) scheduler.Every(1).Hour().Do(func() { log.Printf("%d hour", secondCount/(60*60)) }) stopped := scheduler.Start() wg.Wait() stopped <- true }