php check timeout code example
Example 1: php time a script
$time_start = microtime(true);
for($i=0; $i<1000; $i++){
}
$time_end = microtime(true);
$execution_time = ($time_end - $time_start);
echo '<b>Total Execution Time:</b> '.($execution_time*1000).'Milliseconds';
Example 2: php check timeout
$time_start = microtime(true);
for($i=0; $i<1000; $i++){
}
$time_end = microtime(true);
$execution_time = ($time_end - $time_start);
echo '<b>Total Execution Time:</b> '.($execution_time*1000).'Milliseconds';