Wednesday, April 29, 2015

Get page time load - PHP Snippet

Get page time load - PHP Snippet

Simple php function that find and return page load time.
function loadTime(){
$start = time();

// put a long operation in here
sleep(2);


$diff = time() - $start;

return $diff
}

// if you want a more exact value, you could use the
// microtime function

Disqus Comments