Re: PHP 4.0 Bug #8414: set_time_out() andmax_execution_time description is not clear

From: Date: Mon, 25 Dec 2000 13:43:24 +0000
Subject: Re: PHP 4.0 Bug #8414: set_time_out() andmax_execution_time description is not clear
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-42250@lists.php.net to get a copy of this message
for <?php $i = 30; while($i--) sleep(1); ?> what is the execution time? One would say it is about 30 seconds and other would probably say it is almost zero, cause we did not execute a second... right? I am not sure... Both interpretations makes sense but from the max_execution_time and set_time_limit() description it is not clear what exactly is the "execution time" that they limit. So the documentation should be fixed. try mysql_query("some query running about 1 second") instead of sleep(1) and you will get the same result... set_time_limit() (on unix) counts only the CPU time spend by the process not the "wall" time... BTW, That means there is no way (?) to really limit the time of script execution in sense "no script is allowed to run more than wall 30 seconds"... any stupid user can do while($i--)sleep(1); and hold the whole apache process for a very long time... ?? BTW, what is the set_time_limit() behavior on windows? It seems like on windows it limits the wall time not the CPU time. oleg

« previous php.dev (#42250) next »