sleep or cron job
(heh. no pun intended!)

For a script (or loop in the script) that should be executed every interval, is it better to use a cron job or php sleep()?

Also, for a cron job, how do you set it up to execute at a random (or otherwise changing) interval?