Java Sleep sleep(long timeToSleep)

Here you can find the source of sleep(long timeToSleep)

Description

Sleep and wake on InterruptedException

License

Apache License

Parameter

Parameter Description
timeToSleep in milliseconds

Declaration

public static void sleep(long timeToSleep) 

Method Source Code

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

public class Main {
    /**//ww w. ja  v  a  2s  . c  o m
     * Sleep and wake on InterruptedException
     * @param timeToSleep in milliseconds
     */
    public static void sleep(long timeToSleep) {
        if (timeToSleep <= 0)
            return;
        try {
            Thread.sleep(timeToSleep);
        } catch (InterruptedException e) {
        }
    }
}

Related

  1. sleep(long sleepTime)
  2. sleep(long time)
  3. sleep(long time)
  4. sleep(long time)
  5. sleep(long time)
  6. sleep4Subscription()
  7. sleep_force(long timeToSleep)
  8. sleepABit(long millis)
  9. sleepABitMore()