Re: max_execution_time
| From: | Chris Adams | Date: | Thu, 06 Jul 2000 16:25:28 +0000 |
| Subject: | Re: max_execution_time | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-23727@lists.php.net to get a copy of this message | ||
> How can I take care of the CPU time the script uses
> and do some fall back mechanisms for not to fall into
> max_execution_time ?
You could try something like the completely untested code (no warranty!)
below:
$MaxTime = get_ini('max_execution_time') - 10;
$ElapsedTime = 0;
while ($ElapsedTime < $MaxTime) {
// do stuff
list($ticks, $user_time, $sys_time, $cutime, $cstime) = posix_times();
/* note: need to add $sys_time if PHP uses that for max_execution_time
*/
$ElapsedTime = $user_time;
}