Here you can find the source of pause(long duration, TimeUnit unit)
private static void pause(long duration, TimeUnit unit)
//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 } } }