package yqw.java.util;
public class ThreadUtils {
/**
* showThreadInfo
*
* @return
*/
public static final String showThreadInfo() {
return "^^^^^^^^^^^^^^^^^^^^^^^ currentThread: name=" + Thread.currentThread().getName() + " , id="
+ Thread.currentThread().getId() +
" ,state=" + Thread.currentThread().getState() + " , Priority=" + Thread.currentThread().getPriority();
}
/**
* sleep not catch Exception
*
* @param ms
* @return
*/
public static boolean sleep(int ms) {
try {
Thread.sleep(ms);
return true;
} catch (InterruptedException e) {
return false;
}
}
}
原文地址:https://www.cnblogs.com/yang75n/p/8412963.html
时间: 2024-10-02 23:34:03