Closed 0xg0nz0 closed 7 years ago
Thanks for the suggestions! I think all of them make sense. Unfortunately, I might not get to it immediately, so feel free to send a patch if you like.
Hi Alex, no worries, I will send you a pull request sometime later this week.
Note on this fix: I changed just cases with firstDelay below the resolution -- it still applies for scheduleFixedRate() and scheduleFixedDelay().
It's more correct the way you have it: if minimum precision is 10 milliseconds, then a delay of 0 milliseconds is unachievable, and it's not unreasonable to throw an exception. But requiring anyone who wants to schedule "run as soon as possible" to know the timer wheel's resolution also seems wrong; it might be better to round up to the minimum resolution for delays less than the minimum resolution rather than throwing an exception.