The code will time how long it takes to for the PHP code on the page to process.

Code Snippet

<?php

$start_time = microtime(true);
$end_time = microtime(true);
$total = round(($end_time - $start_time),5);

?>

Sample Usage

<?php

$start_time = microtime(true);
$end_time = microtime(true);
$total = round(($end_time - $start_time),5);

echo $total;

?>


author's photo

Author : Susan Haynes

I have been in software industry for more than 10 years. I have developed different type of software using different languages. I have knowledge in languages such as Ruby, Python, PHP, Flash, .NET, Java, and jQuery. Currently I am working as a Tech Lead in Singapore.

COMMENTS
blog comments powered by Disqus