How to calculate the page execution time?
Author: large matrix workshop Joined: 2004-02-19 Views: 136 Sometimes people see the bottom of the page shows the execution time of a page, a lot of newcomers will want to know how to achieve it? In fact, this is in the PHP manual, please see example
PHP // Define Get Time Function Function Getmicrotime () {List ($ Usec, $ Sec) = EXPLODE ("", Microtime ()); Return (FLOAT) $ usec (float) $ sec);} / / Get start time $ TIME_START = getmicrotime (); // Execute your own code for ($ I = 0; $ I <10; $ i ) {echo 'output';} // After obtaining the execution code $ TIME_END = getMicRotime (); // Calculation results $ TIME = $ TIME_END - $ TIME_START; / / Output Echo "page execution time $ TIME seconds";?>>>>>>