Tag : script-execution-time

Php – script execution time

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";
?>