- substr: documentation ( source)
- microtime: documentation ( source)
- explode: documentation ( source)
- str_pad: documentation ( source)
<?php
$time_start = microtime(true);
$time_end = microtime(true);
$time = $time_end - $time_start;
$array = explode('.', $time);
$msec = str_pad(substr($array[1], 0, 3) , 3, "0");
echo $time;
echo ':';
echo $msec;