📄 opntimer.java
字号:
package edu.thu.airlinerecovery.eof;
import java.util.Timer;
import java.util.TimerTask;
public class OPNTimer {
static Timer timer = new Timer(true);
static Timer timerN = new Timer(true);
public int timePointer=0;
public int timePointerN = 0;
public int getTime(){
// if(timePointer>509){
// System.out.println(timePointerN);
return timePointerN;
// }
// else{
// System.out.println(timePointer);
// return timePointer;
// }
// return timePointer;
}
public void startTiming(){
// timer.schedule(new TimeTask() , 0 , 10);
timerN.schedule(new TimeTaskN() , 0 , 10);
}
public void stopTiming(){
timer.cancel();
}
class TimeTask extends TimerTask{
public TimeTask(){
}
public void run(){
timePointer =timePointer +2;
}
}
class TimeTaskN extends TimerTask{
public TimeTaskN(){
}
public void run(){
timePointerN =timePointerN +2;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -