import java.util.Date;
public class Time {
public static void main(String[] args) throws InterruptedException {
//获得当前的Date时间对象后的30秒
Date d = new Date(System.currentTimeMillis()+30*1000);
int count = 30;
while(new Date().before(d)){
System.out.print(count);
System.out.println("\t");
//停留1s在运行
Thread.sleep(1000);
count--;
}
}
}