Java TimeUnit Calculate sleep(TimeUnit timeUnit, long duration)

Here you can find the source of sleep(TimeUnit timeUnit, long duration)

Description

sleep

License

Apache License

Declaration

public static void sleep(TimeUnit timeUnit, long duration) 

Method Source Code

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

import java.util.concurrent.TimeUnit;

public class Main {
    public static void sleep(TimeUnit timeUnit, long duration) {
        try {//ww  w.j av a 2  s.  co m
            timeUnit.sleep(duration);
        } catch (InterruptedException ex) {
            Thread.currentThread().interrupt();
        }
    }
}

Related

  1. shortName(TimeUnit unit)
  2. sleep(int duration, TimeUnit unit)
  3. sleep(long duration, TimeUnit timeUnit)
  4. sleep(long duration, TimeUnit timeUnit)
  5. sleep(long pTime, TimeUnit pTimeUnit)
  6. sleep(TimeUnit unit, long length)
  7. sleepAndCachedInterruptedException(long sleepFor, TimeUnit unit)
  8. sleepFor(long period, TimeUnit timeUnit)
  9. timeDiff(Calendar end, Calendar begin, TimeUnit timeUnit)