1//Calculate the execution time in PHP
2
3<?php
4
5// Start the clock time in seconds
6$start_time = microtime(true);
7$val=1;
8
9// Start loop
10for($i = 1; $i <=99999; $i++)
11{
12 $val++;
13}
14
15// End the clock time in seconds
16$end_time = microtime(true);
17
18// Calculate the script execution time
19$execution_time = ($end_time - $start_time);
20
21echo " It takes ".$execution_time." seconds to execute the script";
22?>