/**
* 了解
* Timer()
* schedule(TimerTask task, Date time)
schedule(TimerTask task, Date firstTime, long period)
自学quartz
* @author Administrator
*
*/
public class Timer01 {
public static void main(String[] args) {
Timer timer=new Timer();
timer.schedule(new TimerTask() {
@Override
public void run() {
System.out.println("so easy>....");
}
}, new Date(System.currentTimeMillis()+5000),2000);//5秒之后运行,每两秒打印一次
}
}
[线程]——任务调度
最新推荐文章于 2020-02-05 20:57:14 发布