java定时器

public class threed1 extends Thread {
public void run(){
int i = 2000;
while(true){
try {
threed1.sleep(i);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
i++;
System.out.println("开始计时"+i);
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
threed1 t1 = new threed1();

t1.start();
}
}

posted on 2017-08-01 19:01  白超峰  阅读(107)  评论(0编辑  收藏  举报

导航