Function introduction for calculating the runtime of the php page. A function used to calculate the runtime of the php page. Copy the code as follows :? Php * @ calculates the php program running time * functionmicrotime_float () {list ($ usec, $ sec) explode ("",
A function used to calculate the runtime of the php page.
The code is as follows:
/*
@ Calculate the php program running time
*/
Function microtime_float ()
{
List ($ usec, $ sec) = explode ("", microtime ());
Return (float) $ usec + (float) $ sec );
}
// Start timing and place it on the head
$ Starttime = microtime_float ();
// End the timer and place it at the bottom
$ Runtime = number_format (microtime_float ()-$ starttime), 4).'s ';
// Output
Echo 'runtime: '. $ RunTime;
?>
Bytes. The code is as follows :? Php/* @ calculate the php program running time */function microtime_float () {list ($ usec, $ sec) = explode ("",...