Question

I want to run a task after specified delay and at given intervals.

If I use SchedulerExecutorService, since it uses thread so task execution is getting delayed a little bit.

I cannot afford delay in execution.How can I make it run at exact specified interval?

What about Quartz library? This library would solve the purpose?

As I am not very much aware of Quartz library, I would also like to know what is the difference between SchedulerExecutorService and Quartz api?

Note:

I have also asked the question on why is it getting delayed using SchedulerExecutorService.Please refer.

No correct solution

OTHER TIPS

As a general rule of thumb, if you need high availability (you want to have more than one machine to execute the task so that tasks are run even when a machine or app. instance fails), then use Quartz. Otherwise use ScheduledExecutorService.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top