I want to have a timer task that runs two tasks with fixed delays between each task.
For example:
A——B—–A——B
0——10—-20—-30
I tried using this code:
timer.scheduleAtFixedRate(taskA, 0, 10000);
timer.scheduleAtFixedRate(taskB, 10000, 10000);
but that gives me:
A—–A,B—–A,B
0—–10——20
How do I do this using Timer and TimerTask?
Just double your interval: