(1).java睡眠函数
Thread.sleep(时间); //单位为毫秒
(2).java睡眠函数例子
Date dNow = new Date();
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
// 睡眠1分钟,60秒
Thread.sleep(60 * 1000);
System.out.println("当前时间为: " + ft.format(dNow)); (1).java睡眠函数
Thread.sleep(时间); //单位为毫秒
(2).java睡眠函数例子
Date dNow = new Date();
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
// 睡眠1分钟,60秒
Thread.sleep(60 * 1000);
System.out.println("当前时间为: " + ft.format(dNow));