3v4l.org

run code in 300+ PHP versions simultaneously
<?php $start = microtime(true); while (microtime(true) != $start + 1); // Wait a second to start up $loops = 10; $avg = 0; for ($i = 0; $i < $loops; $i++) { $start = microtime(true); for ($c = 0; $c < 1000; $c++) { // the 1000 may vary depending on the function } $end = microtime(true); echo "Take $i: " . ($end-$start) . "s\n"; $avg *= $i; $avg += $end - $start; $avg /= $i + 1; } echo "Average: " . $avg . "s\n";

preferences:
31.84 ms | 402 KiB | 5 Q