Good afternoon, we want to run a script that randomly throughout the day will run various functions.
Execution will be assigned randomly in time from 0 to 24 hours pending. those. before running the script will be the command:
sleep(rand(0, 60*60*24)); // секунды*минуты*часы because There will be a lot of teams to perform, thinking about efficiency.
Tell me whether it is effective to use the sleep command or is there a function that uses less resources?
is it possible to randomly call via cron?
php -r 'sleep(100);'- in the top silence, the CPU does not eat. - Ivan Bolnikh