cron
cron copied to clipboard
Start cronjob at specific epoc time
I want to run cronjob at epoc time with millisecond and work every second. But I couldn't find it. The cron starts at 000 millisecond. I need it starts at specific time. For example, at 1657713890300 epoc timestamp, I will Start() it with "@every 1s" time. Cron must be run next times 1657713891300, 1657713892300, 1657713893300. Currently, cron running at 1657713891000, 1657713892000, 1657713893000. Is it possible?
@JSDeve I made a fork of this repo that addresses almost all issues of this repo. https://github.com/alaingilbert/cron
This is how you could do what you want to do ->
_, _ = c.AddJob("* * * * * *", func() {
// ...
}, cron.WithNext(/* Your time.Time here */))