The
microtime()
function returns the current Unix timestamp and microseconds.
echo(microtime());
0.478130001451273280
microtime(true)
returns a floating point number
Calculate running time code:
$startTime = microtime(true);
$endTime = microtime(true);
$runTime = ($endTime-$startTime)*1000 . ' ms';
The above introduces the PHP calculation program running time, including aspects of the content. I hope it will be helpful to friends who are interested in PHP tutorials.