+ $seconds = (time() - $start);
+
+ // logarithmic wait time calculation.
+ // Background: After jobs had been started, they often fork many workers.
+ // To not waste too much time, the sleep period increases.
+ $arg = (($seconds + 1) / ($wait_interval / 9)) + 1;
+ $sleep = round(log10($arg) * 1000000, 0);
+ usleep($sleep);
+
+ $timeout = ($seconds >= $wait_interval);
+ } while (!$timeout && !Worker::IPCJobsExists());