我有以下代码:
Timer timer = new Timer();
TimerTask task = new TimerTask() {
@Override
public void run() {
// TODO Auto-generated method stub
}
};
timer.schedule(task, 10000);//execute after 10 seconds
我们可以确定任务是已经被定时器执行了还是到期了?