Thread sleep For Millis - Java java.lang

Java examples for java.lang:Thread

Description

Thread sleep For Millis

Demo Code


//package com.java2s;

public class Main {
    public static void main(String[] argv) throws Exception {
        long millis = 2;
        sleepForMillis(millis);/*ww w .j  ava 2 s . c  o m*/
    }

    public static void sleepForMillis(long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException swallow) {
        }
    }
}

Related Tutorials