/** * Cause a thread to nap. * */ public class Sleep { private static final int LONG_SLEEP = 5; /** * Nap for zero to LONG_SLEEP seconds */ public static void nap() { int naptime = (int) (LONG_SLEEP * Math.random()); try{ Thread.sleep( naptime * 1000 ); } catch( InterruptedException e ) {} } } //Sleep