In lists/admin/actions/processqueue.php, REPLACE
sleep($delaytime);
printf('<script type="text/javascript">
document.location = "./?page=pageaction&action=processqueue&ajaxed=true&reload=%d&lastsent=%d&lastskipped=%d%s";
</script></body></html>', $reload, $counters['sent'], $notsent, addCsrfGetToken());
with
if (defined('JSLEEPMETHOD')) {
printf('<script type="text/javascript">
setTimeout(function() {
document.location = "./?page=pageaction&action=processqueue&ajaxed=true&reload=%d&lastsent=%d&lastskipped=%d%s";
}, %d);
</script></body></html>', $reload, $counters['sent'], $notsent, addCsrfGetToken(), $delaytime*1000);
} else {
sleep($delaytime);
printf('<script type="text/javascript">
document.location = "./?page=pageaction&action=processqueue&ajaxed=true&reload=%d&lastsent=%d&lastskipped=%d%s";
</script></body></html>', $reload, $counters['sent'], $notsent, addCsrfGetToken());
}
also add
to config/config.php
NOTES
The amended section is only accessed in browser context, not by cron.
By using a define, if undeclared, current function is unchanged.
Allows for further expansion of this functionality by using various values of JSLEEPMETHOD
Instead of concurrent connections to same website/server hanging during the sleep() process, new method allows concurrent operations and ties up less resources