This function will pause the script’s execution for the number of seconds given. Keep in mind that the script timeout setting will not be affected by this as that is only concerned with the execution time.

The value given must be a non-negative whole number. A negative number will generate a warning.

// Before
echo date('H:i:s');
 
// Sleep 5 seconds
sleep(5);
 
// After
echo "\n" . date('H:i:s');
/*
21:29:40
21:29:45
*/