Running multiple TimerTask
Hi All
I want to be able to run multiple TimerTasks.
The following snippet of code has only Task2 executed every 5 seconds. Task1 never gets executed. (I use jdk1.4)
import java.util.Timer;
import java.util.TimerTask;
publicclass Scheduler{
publicstaticvoid main(String[] args){
TimerTask task1 =new MyTask();
TimerTask task2 =new MyTask2();
Timer timer =new Timer();
timer.schedule(task1, 1000);
timer.schedule(task2, 500);
}
}
Can you please tell me how to schedule multiple tasks.
Thanks
bib

