- microtime: documentation ( source)
- round: documentation ( source)
<?php
$s = microtime(true);
$a = array();
$i = 0;
for ($i = 0; $i < 1000; $i++)
{
$a[] = $i;
}
$e = microtime(true);
echo round(($e - $s) * 1000, 1) . " ms";
echo round(($e - $s) * 1000, 1) . " ms";