Here you can find the source of randomDelay()
static public void randomDelay()
//package com.java2s; //License from project: Open Source License import java.util.concurrent.ThreadLocalRandom; public class Main { private static final int MIN_DELAY_IN_MS = 750; private static final int MAX_DELAY_IN_MS = 1000; static public void randomDelay() { int delayInMS = ThreadLocalRandom.current().nextInt(MIN_DELAY_IN_MS, MAX_DELAY_IN_MS); try {/*from www . j a v a 2s . co m*/ Thread.sleep(delayInMS); } catch (InterruptedException e) { throw new RuntimeException(e); } } }