public class Test{
// 升序排序
public static List<Integer> sort(List<Integer> list) throws Exception {
List<Integer> resultList = new ArrayList<>();
for (int i : list) {
new Thread() {
public void run() {
try {
Thread.sleep(i * 1000);
resultList.add(i);
} catch (Exception e) {
e.printStackTrace();
}
};
}.start();
}
;
while (true) {
if (Thread.activeCount() == 1) {
break;
}
Thread.sleep(100);
}
return resultList;
}
// 获取一天后的时间
public static Date getNextDate() throws Exception {
Thread.sleep(24 * 3600 * 1000);
return new Date();
}
}
程序员的睡觉编程艺术
最新推荐文章于 2022-08-14 00:37:34 发布