Thread.sleep()线程睡眠的方法使用

public class ThreadSleep {
     
    public static void main(String[] args) {
     
        for (int i = 0; i < 60; i++) {
     
            System.out.println(i);
            try {
     
                Thread.sleep(1000);
            } catch (InterruptedException e) {
     
                e.printStackTrace();
            }
        }
    }
}

你可能感兴趣的:(Java多线程基础,多线程,java,thread)