- microtime: documentation ( source)
- set_time_limit: documentation ( source)
- strtotime: documentation ( source)
<?php
set_time_limit(10);
$startTime = microtime(true);
$newTime = strtotime('+10 second');
while (true) {
if($newTime >= $startTime) {
break;
}
}
echo 'Total execution time in seconds: ' . (microtime(true) - $startTime);