-
Notifications
You must be signed in to change notification settings - Fork 702
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
Add milliseconds support for the interval scheduler #323
Conversation
1 similar comment
The same would hold true for milliseconds too, at least when using a persistent job store. What is your use case for millisecond accuracy anyway? |
I am interfacing with an API that allows three requests per second, and I would like to be able to request as much data as possible. I installed my fork's version of the package into my project, and found that I have roughly +/- 2 milliseconds on most queries. I haven't done any long haul or heavy load testing; are there any tests that I could add that you think would provide a useful insight to the precision in all cases? I'm considering writing a test case that simply starts a few timers with some millisecond duration, lets them all run and log the times that they actually run at, and ensuring that the precision is within some factor. My biggest concern here, though, is that test would likely run different on different (especially slower) platforms. |
I will consider this for the next release. |
+1 I was looking for this exact functionality so it'd be really nice to have it in a proper release. My use case is that need to run some jobs with a 100~500ms frequency for a trading system.
|
I'm hoping to set some time aside this summer to work on APScheduler 4.0. Note that the scheduler is not real-time and won't be in the foreseeable future, but the ability to specify execution times on the millisecond level has been requested by quite a few people so I think I'll just go ahead and do it. Just don't complain if the jobs don't exactly start at the designated sub-second times. |
We need this for Celery 5. |
Millisecond intervals are supported in master. |
Because of the way you implemented this (using timedeltas), the change involves very few lines of code.
I opted out of implementing this as microseconds, as it is unlikely that a scheduler running on any normal computer could actually uphold microsecond precision.