If you have a script that requires a random pause delay --- for example, perhaps a web scraper --- here's a super simple way to do it.
usleep(rand(1000,3000));
The rand() function is being fed two numbers; the lowest number to generate, and the highest.
The usleep() function causes a script to pause for a specified number of microseconds.
So the code above is saying "randomly sleep between 1000-3000 microseconds", which means 1-3 actual seconds.
Simple, and effective!
So excited I found this article as it made thgins much quicker!
Jory @ 10:47:40 AM, Sunday, October 23, 2011