You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cron4s currently preserves the milliseconds of the from value to the next() function and keeps it in the return value.
Let's say a task takes 100ms to perform. I set up "* * * * * *" as the CronExpr. Each time after the task is performed, I ask CronExpr to find the next once-a-second time based on the current time. I would expect to perform the task 60 times a minute, only slipping if the task itself lasted longer than one second. But because of drift caused by the current implementation I guess it would only be performed 54 times.
To avoid this kind of drift in cron-expressions that have periods of something triggering every second, the milliseconds-part of the returned time must be set to 0 (or you would have to keep an "origin" time around to use as milliseconds reference, which seems like a lot of extra complexity for no gain).
The text was updated successfully, but these errors were encountered:
cron4s currently preserves the milliseconds of the
from
value to the next() function and keeps it in the return value.Let's say a task takes 100ms to perform. I set up "* * * * * *" as the CronExpr. Each time after the task is performed, I ask CronExpr to find the next once-a-second time based on the current time. I would expect to perform the task 60 times a minute, only slipping if the task itself lasted longer than one second. But because of drift caused by the current implementation I guess it would only be performed 54 times.
To avoid this kind of drift in cron-expressions that have periods of something triggering every second, the milliseconds-part of the returned time must be set to 0 (or you would have to keep an "origin" time around to use as milliseconds reference, which seems like a lot of extra complexity for no gain).
The text was updated successfully, but these errors were encountered: