Java--定时

 1 TimerTask task = new TimerTask() {
 2 
 3             @Override
 4             public void run() {
 5                 // TODO Auto-generated method stub
 6                 synchronized (lock) {
 7                     lock.notify();
 8                 }
 9             }
10         };
11         Timer timer = new Timer();
12         long delay = 0;
13         long intevalPeriod = 1000;
14         timer.schedule(task, delay, intevalPeriod);

 

posted @ 2017-02-04 16:05  MicroCat  阅读(109)  评论(0编辑  收藏  举报