MCPcopy Create free account
hub / github.com/LisenCoding/cangku / MyThreadMethod

Class MyThreadMethod

boot/src/main/java/com/thread/MyThreadMethod.java:6–19  ·  view source on GitHub ↗

线程执行方法(做一些项目启动后 一直要执行的操作,比如根据时间自动更改订单状态,比如订单签收30天自动收货功能,比如根据时间来更改状态)

Source from the content-addressed store, hash-verified

4 * 线程执行方法(做一些项目启动后 一直要执行的操作,比如根据时间自动更改订单状态,比如订单签收30天自动收货功能,比如根据时间来更改状态)
5 */
6public 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected