Php – script execution time
Posted on: October 2, 2010 /
Categories: PHP
To view php script execution time insert next code into your script.
Insert next code at the top of the page:
<?php
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$starttime = $mtime;
?>
Insert next code at the bottom of the page:
<?php
$mtime = microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$endtime = $mtime;
$totaltime = ($endtime - $starttime);
echo "Time execution: ".$totaltime." seconds";
?>