How can you accurately measure the loading time of multiple pages in PHP?

To accurately measure the loading time of multiple pages in PHP, you can use the microtime() function to capture the start and end times of each page load. By calculating the difference between these two times, you can determine the exact loading time of each page.

// Start time
$start_time = microtime(true);

// Code for loading the page

// End time
$end_time = microtime(true);

// Calculate loading time
$loading_time = $end_time - $start_time;

echo "Page loaded in " . $loading_time . " seconds.";