note 22122 added to function.set-time-limit
| From: | opaf at yahoo dot com | Date: | Fri, 07 Jun 2002 13:47:43 +0000 |
| Subject: | note 22122 added to function.set-time-limit | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-31560@lists.php.net to get a copy of this message | ||
It seems that set_time_limit does take into account the time spent in functions like sleep:
<?PHP
echo "<html>\n" ;
echo "<body>\n" ;
echo "Time limit: 10 seconds<br/>" ;
echo "Timer: <span id=\"counter\"></span><br/>\n" ;
echo "</html>" ;
set_time_limit ( 10 ) ;
$w = 0 ;
while ( true ) {
$w ++ ;
flush () ;
sleep ( 1 ) ;
echo "<script>document.all.counter.innerHTML =
\"$w\";</script>\n";
}
?>
The above script will never reach 10 seconds.
--
http://www.php.net/manual/en/function.set-time-limit.php
http://master.php.net/manage/user-notes.php?action=edit+22122
http://master.php.net/manage/user-notes.php?action=delete+22122
http://master.php.net/manage/user-notes.php?action=reject+22122