()
| 5 | */ |
| 6 | public class MyThreadMethod extends Thread { |
| 7 | public void run() { |
| 8 | while (!this.isInterrupted()) {// 线程未中断执行循环 |
| 9 | try { |
| 10 | Thread.sleep(5000); //每隔2000ms执行一次 |
| 11 | } catch (InterruptedException e) { |
| 12 | e.printStackTrace(); |
| 13 | } |
| 14 | |
| 15 | // ------------------ 开始执行 --------------------------- |
| 16 | // System.out.println("线程执行中:" + System.currentTimeMillis()); |
| 17 | } |
| 18 | } |
| 19 | } |
no outgoing calls
no test coverage detected