[PHP-WIN] Programming in the small WAS: [PHP-WIN] escape loop on timeout

2001-05-22 Thread Svensson, B.A.T.
>for ($x=0; $x < 10; ++$x) { > >if ( (0 === ($x % 1000)) && (time () - $start_time) > $timeout) >break; > >echo ($x, ''); >} I am a little bit conservative when it comes to use the break-statement, and the rule of thumb I uses is; any singular block sh

Re: [PHP-WIN] escape loop on timeout

2001-05-22 Thread Johan Lundqvist
U R right Zak, I'm a bit dizzy today, thanx. -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP-WIN] escape loop on timeout

2001-05-22 Thread Zak Greant
Johan Lundqvist wrote: > This is a way of doing it: > > $s = time() + 10; > for ($i = time(); $i <= $s; $i++) { > print $i; > } > > Will run for about ten seconds... Did you leave a bit of code out? In most cases, this will run for only a few milliseconds. :) Try something like

Re: [PHP-WIN] escape loop on timeout

2001-05-22 Thread Johan Lundqvist
This is a way of doing it: $s = time() + 10; for ($i = time(); $i <= $s; $i++) { print $i; } Will run for about ten seconds... /Johan Brendan Gogarty wrote: > > hi, > just wondering if there was any easy way to break/escape from a loop > (for loop) if the loop exceeds a maximum time. > I r

[PHP-WIN] escape loop on timeout

2001-05-21 Thread Brendan Gogarty
hi, just wondering if there was any easy way to break/escape from a loop (for loop) if the loop exceeds a maximum time. I realise that set_timeout applies to the whole script but i am just interested in a sub function of the script. cheers! brendan. -- PHP Windows Mailing List (http://www.p