I have need for timer code in Java with these features:
- Setting pieces of codes (
Runnable
or something like it) to execute once after a specific delay (with second precision) - Changing the delay of an existing timer after the fact and cancelling timers.
- Using a thread pool (so no
java.util.Timer
)
I've looked into using Quartz, but it appears to be simply too large.
Is there a smallish library that does this? Or can I actually use Quartz? Or how would I implement it myself, using ScheduledExecutor
?