<?php declare(strict_types=1); $fila = range(1, 20000); // prueba con 10_000, 20_000 y 40_000 $atendidos = 0; $t0 = hrtime(true); /* while ($fila) { $cliente = array_shift($fila); $atendidos++; } */ /* foreach ($fila as $cliente) { $atendidos++; } */ while ($atendidos < count($fila)) { $cliente = $fila[$atendidos]; $atendidos++; } $t1 = hrtime(true); echo "Atendidos: {$atendidos}", PHP_EOL; echo "DemorĂ³: ", ($t1 - $t0) / 1e6, " ms";
You have javascript disabled. You will not be able to edit any code.