标签:port oid rri task timer ati ack 定时 can
package com.yh.thread;
import java.util.Timer;
public class TimeTest01 {
public static void main(String[] args) {
Timer t=new Timer();
t.schedule(new MyTimer(t), 1000);
}
}
package com.yh.thread;
import java.util.Timer;
import java.util.TimerTask;
public class MyTimer extends TimerTask{
private Timer timer;
public MyTimer(Timer timer){
this.timer=timer;
}
@Override
public void run() {
System.out.println("定时器在执行");
timer.cancel();
}
}
标签:port oid rri task timer ati ack 定时 can
原文地址:https://www.cnblogs.com/god1/p/12080285.html