public static void randomDelay(int ms) {
    try {
      Thread.sleep(ThreadLocalRandom.current().nextInt(ms));
    } catch (InterruptedException e) {
      throw new RuntimeException("Interrupted", e);
    }
  }
public static void randomDelay ( int ms ) { try { Thread . sleep ( ThreadLocalRandom . current ( ) . nextInt ( ms ) ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( "Interrupted" , e ) ; } }
Suspends the current thread for a random number of millis between 0 and
the indicated limit.

@param ms max number of millis