📄 cachetimer.java
字号:
package org.ehotsoft.yekki.util.cache;
public class CacheTimer extends Thread {
private long updateInterval;
public CacheTimer(long updateInterval) {
this.updateInterval = updateInterval;
//Make the timer be a daemon thread so that it won't keep the VM from
//shutting down if there are no other threads.
this.setDaemon(true);
//Start the timer thread.
start();
}
public void run() {
//Run the timer indefinetly.
while (true) {
Cache.currentTime = System.currentTimeMillis();
try {
sleep(updateInterval);
}
catch (InterruptedException ie) { }
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -