java - Schedule the same task for different time interval -
is possible schedule 1 task different time intervals? here fixed interval example:
timer gtimer = new timer(); calendar startdate = calendar.getinstance(); startdate.set(calendar.hour_of_day, 9); startdate.set(calendar.minute, 45); startdate.set(calendar.second, 00); scheduleclass scheduleclass = new scheduleclass(); gtimer.schedule(scheduleclass, startdate.gettime(), 1000 * 60 * 2); //interval 2 minutes
this snippet of scheduleclass has run function , successful run every 2 minutes. question is: how can set interval every 2, 5 , 7 minutes?
when copy scheduler 3 times throws error:
severe: standardwrapper.throwable
java.lang.illegalstateexception: task scheduled or cancelled`
all suggestions welcome!
Comments
Post a Comment