Java TimeUnit Usage sleepMilliseconds(long milliseconds)

Here you can find the source of sleepMilliseconds(long milliseconds)

Description

Sleep in the unit of milliseconds.

License

Apache License

Parameter

Parameter Description
milliseconds a parameter

Declaration

public static void sleepMilliseconds(long milliseconds) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.concurrent.TimeUnit;

public class Main {
    /**/*from   w w  w.  j a v  a  2  s. c o  m*/
     * Sleep in the unit of milliseconds.
     * @param milliseconds
     */
    public static void sleepMilliseconds(long milliseconds) {
        try {
            TimeUnit.MILLISECONDS.sleep(milliseconds);
        } catch (InterruptedException e) {
        }
    }
}

Related

  1. sleep(int millis)
  2. sleep(long durationMillis)
  3. sleep(long millis)
  4. sleep(long milliseconds)
  5. sleepForSeconds(int seconds)
  6. sleepNanos(long nanoDuration)
  7. sleepNanos(long nanoDuration)
  8. sleepQuietly(int seconds)
  9. sleepSeconds(int secs)