Java TimeUnit Usage sleep(long millis)

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

Description

sleep

License

Apache License

Declaration

public static void sleep(long millis) 

Method Source Code

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

import java.util.concurrent.TimeUnit;

public class Main {
    public static void sleep(long millis) {
        sleep(millis, TimeUnit.MILLISECONDS);
    }//www  .  j  a v a  2s  . com

    private static void sleep(long amount, TimeUnit unit) {
        try {
            Thread.sleep(unit.toMillis(amount) * getTimeFactor());
        } catch (InterruptedException e) {
            // Ignore it.
        }
    }

    public static int getTimeFactor() {
        return Integer.getInteger("time.factor", 1);
    }
}

Related

  1. secondsToYearsDaysHoursMinutesSeconds(double seconds)
  2. selectDurationUnitForDisplay(long durationInNanos)
  3. sleep()
  4. sleep(int millis)
  5. sleep(long durationMillis)
  6. sleep(long milliseconds)
  7. sleepForSeconds(int seconds)
  8. sleepMilliseconds(long milliseconds)
  9. sleepNanos(long nanoDuration)