To measure the speed of page generation in PHP, insert the following code at the beginning of the script:
// Breathing start time of page generation
$start_array = explode(" ",microtime());$start_time = $start_array[1] + $start_array[0];
And at the end of the script we write this:
// Calculating the speed of page generation
$end_array = explode(" ",microtime());$time = $end_array[1] + $end_array[0] - $start_time;
printf("Generated in %f sec.",$time);
Why in the script?
To minimize the time for calculation of page generation in PHP, it is better to insert the code in the main script to minimize the accesses to the hard disk, and thus reduce the loss of time.