Saturday, June 11, 2016

How to measure the speed of a website using php?

Simplest way to measure any webpage response time is use Firefox or Chrome developer menu options which display the total access time to the server.

However if you need to do this in PHP then it be done by simple method like below.

 $startTime = microtime(true);

function measureTime(){
global $startTime;
= microtime(true)-$startTime;
"Script execution time: $execTime seconds.";