Skip to content

Instantly share code, notes, and snippets.

@error454
Created September 7, 2011 23:38
Show Gist options
  • Save error454/1202171 to your computer and use it in GitHub Desktop.
Save error454/1202171 to your computer and use it in GitHub Desktop.
Java random delay
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