1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00
Oinktube/vendor/react/event-loop/examples/94-benchmark-timers-delay.php
2021-10-05 14:32:55 -03:00

18 lines
360 B
PHP

<?php
use React\EventLoop\Loop;
require __DIR__ . '/../vendor/autoload.php';
$ticks = isset($argv[1]) ? (int)$argv[1] : 1000 * 100;
$tick = function () use (&$tick, &$ticks) {
if ($ticks > 0) {
--$ticks;
//$loop->futureTick($tick);
Loop::addTimer(0, $tick);
} else {
echo 'done';
}
};
$tick();