Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to check page loading time in php

$startTime = array_sum(explode(" ",microtime()));
error_log("Started time=======".$startTime);


echo "=======Your Code=======";
echo "=======Your Code=======";
echo "=======Your Code=======";
echo "=======Your Code=======";
echo "=======Your Code=======";


$endTime = array_sum(explode(" ",microtime()));
error_log("Started time=======".$endTime);

$timeTaken = round(($endTime - $startTime),2);

error_log("Page loaded in $timeTaken seconds");
 
PREVIOUS NEXT
Tagged: #check #page #loading #time #php
ADD COMMENT
Topic
Name
8+1 =