Created
September 7, 2011 23:38
-
-
Save error454/1202171 to your computer and use it in GitHub Desktop.
Java random delay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void randomDelay(float min, float max){ | |
int random = (int)(max * Math.random() + min); | |
try { | |
Thread.sleep(random * 1000); | |
} catch (InterruptedException e) { | |
// TODO Auto-generated catch block | |
e.printStackTrace(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment