How do I use php to get the execution time of a program

  • 2020-06-12 08:44:26
  • OfStack

Add to head. htm, that is, add "$stime=microtime(true); // Get the start time of program execution"

<!--<?php
$stime=microtime(true); // Gets the time when the program starts executing 
$GuideFid[$fid]=str_replace("<a href='$webdb[www_url]' class='guide_menu'>> Home page </a>","",$GuideFid[$fid]);
$fupId=intval($fupId);
$topMenu[$fupId]='ck';
print <<<EOT
-->

Here is the web page
Again in ES9en. htm modify as follows:

<!--
EOT;
$etime=microtime(true);// Gets the time when the program execution ends 
$total=$etime-$stime;   // Calculate difference 
echo "<br />[ Page execution time: {$total} ] seconds ";
?>


Related articles: