Calculate Webpage Load Time in PHP
Posted: Fri Sep 04, 2009 3:26 am
Paste following code at the beginning of the page.
Paste following code at the end of the page.
Code: Select all
$m_time = explode(" ",microtime());
$m_time = $m_time[0] + $m_time[1];
$loadstart = $m_time;
Code: Select all
$m_time = explode(" ",microtime());
$m_time = $m_time[0] + $m_time[1];
$loadend = $m_time;
$loadtotal = ($loadend - $loadstart);
echo "<small><em>Generated page in ". round($loadtotal,3) ." seconds</em></small>";