Here you can find the source of sleepNoException(int ms)
public static void sleepNoException(int ms)
//package com.java2s; //License from project: Open Source License public class Main { public static void sleepNoException(int ms) { try {//w w w .j a va2 s . c om Thread.sleep(ms); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException("Sleep was interrupted"); } } public static void sleepNoException(int min, int max) { int ms = random(min, max); try { Thread.sleep(ms); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException("Sleep was interrupted"); } } public static int random(int min, int max) { return (int) (min + (Math.random() * max)); } public static double random(double min, double max) { return (min + (Math.random() * max)); } public static long random(long min, long max) { return (min + ((long) Math.random() * max)); } }