package com.fenet.insurance.framework.datahub.container;
public class Test {
public static void main(String[] args) {
System.out.println("测试开始");
TestThraed test = new TestThraed();
Thread t = new Thread(test);
t.start();
}
}
class TestThraed implements Runnable{
public void run() {
while(true){
System.out.println("线程休眠5秒");
try {
//代码执行完这行会停止5秒然后继续执行
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.println("线程已经入休眠");
}
}
}