double random = Math.random();
int timeInterval = (int) (10 * random);
//睡眠
try {
TimeUnit.SECONDS.sleep(timeInterval);
} catch (InterruptedException e) {
e.printStackTrace();
}
java睡眠
最新推荐文章于 2024-03-29 08:54:38 发布