Get the execution time of the PHP program

update time:2017-07-21 14:20:10
If you want calculate a PHP code execution time and reduce execution time, try the code below.
Code From: http://www.phperz.com/php/introduction/09153L320113763.html

   <?php
        function get_microtime() 
        { 
            list($usec, $sec) = explode(' ', microtime()); 
            return ((float)$usec + (float)$sec); 
        }  
    $start    =    get_microtime(); 
    for ($i=1;$i<1000000;$i++)
    {
        //echo $i;
    }
    $end    =    get_microtime(); 
    echo round(($end- $start) * 1000, 1);      
    ?>

Related posts:

Leave a Reply

Your email address will not be published.