Java Sleep sleep(long millis)

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

Description

sleep

License

LGPL

Declaration

public static void sleep(long millis) 

Method Source Code

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

public class Main {
    public static void sleep(long millis) {
        long now = System.currentTimeMillis();
        long remaining = millis - (System.currentTimeMillis() - now);
        while (remaining > 0) {
            try {
                Thread.sleep(remaining, 0);
            } catch (InterruptedException e) {
            }/* w  ww .j av  a 2  s  .  c om*/
            remaining = millis - (System.currentTimeMillis() - now);
        }
    }
}

Related

  1. sleep(long millis)
  2. sleep(long millis)
  3. sleep(long millis)
  4. sleep(long millis)
  5. sleep(long millis)
  6. sleep(long milliseconds)
  7. Sleep(long milliseconds)
  8. sleep(long milliTime)
  9. sleep(long ms)