指定线程延迟时间(毫秒)

来源:互联网 发布:中国银行密码控件mac 编辑:程序博客网 时间:2024/06/05 05:44
package com.hfxt.p4;public class ThreadTest {public static void main(String[] args) {System.out.println("等待...");//阻塞(等待)时间用Thread.sleep方法try {Thread.sleep(5000);} catch (InterruptedException e) {e.printStackTrace();}System.out.println("继续...");}}

0 0