# README
Cron
This package is a fork of github.com/robfig/cron/[email protected]
which adds support for mocking the time using k8s.io/utils/clock
See LICENSE for the license of the original package.
Using Cron with Mock Clock
import "k8s.io/utils/clock"
clk := clock.RealClock{}
c := cron.New(cron.WithClock(clk))
c.AddFunc("@every 1h", func() {
fmt.Println("Every hour")
})
c.Start()
clk.Add(1 * time.Hour)