I am puzzled with "Timer" and could not find a work around. Can
anyonr help? I have a test code below and it seems to work fine.
However while this is running and adjust the PC clock manually to the
past time lie one hour ago, this timer thread stops to operate. I
want this timer continuously to run. Thank you for your help in
advance.
Timer timer = new Timer(true);
UpdateClockTime task;
task = new UpdateClockTime();
timer.schedule(task, 0L, 1000L);
class UpdateClockTime extends TimerTask {
int cnt;
public UpdateClockTime() {
cnt=0;
}
public void run() {
System.out.println("COUNTER="+cnt);
cnt++;
}
}