Java TimeUnit Calculate pause(long duration, TimeUnit unit)

Here you can find the source of pause(long duration, TimeUnit unit)

Description

pause

License

Apache License

Declaration

private static void pause(long duration, TimeUnit unit) 

Method Source Code

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

import java.util.concurrent.TimeUnit;

public class Main {
    private static void pause(long duration, TimeUnit unit) {
        try {/*w w w  .  j  a v a 2s.co  m*/
            Thread.sleep(unit.toMillis(duration));
        } catch (InterruptedException e) {
            // do nothing
        }
    }
}

Related

  1. logTiming(String description, int n, long time, TimeUnit unit)
  2. mapByName(TimeUnit... units)
  3. minus(Date date, int interval, TimeUnit unit)
  4. parseTimeUnit(final String unit)
  5. parseTimeUnit(Object property, TimeUnit defaultValue)
  6. printTime(long time, TimeUnit unit)
  7. randomSleep(int duration, TimeUnit timeUnit)
  8. resetWithClockStep(long clockStep, TimeUnit clockStepUnit)
  9. run(final Runnable runnable, long timeout, TimeUnit unit)