Java Sleep sleepFor(int sleepDurationInMilliseconds)

Here you can find the source of sleepFor(int sleepDurationInMilliseconds)

Description

Attempts to sleep for a specified period

License

Open Source License

Parameter

Parameter Description
sleepDurationInMilliseconds a parameter

Declaration

public static void sleepFor(int sleepDurationInMilliseconds) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*  w w w  .  j  a va 2 s  . com*/
     * Attempts to sleep for a specified period
     *
     * @param sleepDurationInMilliseconds
     */
    public static void sleepFor(int sleepDurationInMilliseconds) {
        try {
            Thread.sleep(sleepDurationInMilliseconds);
        } catch (InterruptedException e) {
            System.out.println("Error sleeping thread for: " + sleepDurationInMilliseconds);
        }
    }
}

Related

  1. sleepCurrentThread()
  2. sleepDeep(long millis)
  3. sleepExp(int countFailures)
  4. sleepFixed(int milliSecond)
  5. sleepFor(int delay )
  6. sleepFor(long millis)
  7. sleepForAuditGranularity()
  8. sleepForever()
  9. sleepForever()