PHP Snippet 1:
// init priorities array in seconds
$schedules = [
'high' => 1,
'medium'=> 5,
'low' => 30
];
while($now ??= time()) {
foreach($schedules as $priority => $seconds) {
if($now >= $next[$priority] ??= $now) {
$next[$priority] += $seconds;
// --> execute your script here for every priority
// in my case I call high.php, medium.php and low.php with
// with execInBackground() by TheUO available here :
// https://stackoverflow.com/a/12117258/2282880;
// something like execInBackground("scripts/", "$priority.php");
}
}
time_sleep_until(++$now);
}