Here you can find the source of randomSleep(long ms)
Parameter | Description |
---|---|
ms | max time |
public static void randomSleep(long ms)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w . j a v a 2 s. c om*/ * Sleep for a short random amount of time * * @param ms max time */ public static void randomSleep(long ms) { try { Thread.sleep((long) (ms * Math.random())); } catch (InterruptedException e) { } } }