timertask - Java Timer : Cancel all the missed exections -


i using

scheduleatfixedrate(timertask task, date firsttime, long period)  

in program. if start time passed, tasks missed between start time , current time executed. documentation says:

as consequence of above, if scheduled first time in past, "missed" executions scheduled immediate "catch up" execution.

is there way stop these "catch up" executions?

i think best can use schedule call instead:

schedule(timertask task, long delay, long period) 

and beforehand calculate delay required first task start. if desired start time has passed use delay of 0. this:

long delay = starttime.gettime() - system.currenttimemillis(); delay = delay < 0 ? 0 : delay; 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -