-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for seconds (possibly milliseconds) #1
Comments
I completely agree, and was thinking about that today. Those are definitely the right aliases. Also, implementation should be really simple. Milliseconds seems like too much and if you actually need a task to run at an exact millisecond, JavaScript may not be the best language to help you out with that anyway. I was also thinking about adding an interval syntax similar to the cron I already used the
Thoughts? |
👍 on not overloading the I really like the syntax, as I think it makes things very terse yet readable. I haven't dug too far into the internals, would the implementation be all that difficult? |
I actually don't think it'll be too difficult to implement. Internally, I turn all arguments into a range. So, |
Seconds is implemented. That was easy, as expected. Implementing modulus turned out to be a tremendous pain in the ass, specifically because it has to account for split intervals (such as The upside is that once split intervals were generalized (instead of only supported on days of week), it meant that enabling split intervals on everything else was trivial. So stuff like Anyway, modulus is now implemented and documented in the readme. It could probably use some more examples, but I don't really feel like adding any right this moment. Published as |
Seconds
Proposed keywords:
s
,sec
,seconds
,secondofminute
,secondsofminute
(for consistency).This would allow describing a repeating task at sub-second resolution, rather than the default smallest unit being minutes, which could be useful if you wanted a repeating task say on the minute and at :30 seconds (twice a minute).
Also, milliseconds could possibly be useful, although when you need sub-1s resolution, I'm not sure that aligning the events to a specific millisecond is really useful.
What do you think?
The text was updated successfully, but these errors were encountered: