The difference between cron.New() and cron.New(cron.WithSeconds()) ?
illustrate: I know that cron.New() doesn't support seconds, but cron.New(cron.WithSeconds()) does. question: What I'm curious about is what are the pros and cons between the two? Is there a difference in performance? thanks~
There is no difference in performance using these two options, I guess. If we look under the hood, we will see, that it uses *time.Timer in both cases.
Option cron.WithSeconds() allows you to use seconds in your cron scheduling parameter. The main difference between these two options is that the classic format of cron contents only 5 fields: (minute hour day_of_the_month month day_of_the_week). On the other hand, it is sometimes useful to run your job at the certain second, and option cron.WithSeconds() allows you to do it (format is (second minute hour day_of_the_month month day_of_the_week)).