Timer timer;
public Scheduler (int seconds, int period) {
timer = new Timer();
timer.scheduleAtFixedRate(new RemindTask(), seconds * 1000, period * 1000);
}
}
class RemindTask extends TimerTask {
public void run() {
// performing task operation
}
}
calling this scheduler as : new Scheduler(10,7);
No comments:
Post a Comment