Re: sleep and usleep not working ??

From: Date: Fri, 26 Jan 2001 09:35:25 +0000
Subject: Re: sleep and usleep not working ??
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-36790@lists.php.net to get a copy of this message
Hi Sorry - but as far as I can tell it does not work. It still have the same strange behavior. When using sleep I have no output. Usleep has no wait time (or it may delay output a bit but not program execution) ????? Benny ""Daniel Grace"" <dewin@oldbattery.com> skrev i en meddelelse news:94m72k$qd9$1@toye.p.sourceforge.net... > ""Benny Nissen"" <news@beastware.dk> wrote in message > news:94k0ql$em$1@toye.p.sourceforge.net... > > Hi All > > > > I have tried to get this to work but it does not produce any output in the > > browser - why > > > > $i = 1; > > while ($i) > > { > > if(connection_aborted()) > > break; > > > > echo $i; > > echo "<BR>"; > > $i++; > > > > sleep(1); > > //usleep(1000); > > } > > > > If you're trying to get a delayed output affect (which isn't recommended, > but would probably work in this case as long as you're not inside a table), > you'll either need to do: > > ob_implicit_flush(1); > // at the beginning of the script (use 0 to turn it back off) > > or: > flush(); // after the echo and before the sleep. > > > > Side note: When you're using PHP for shell scripts (Don't look at me like > that) and the like, ob_implicit_flush is your friend. > > -- > - Daniel Grace <http://dewin.oldbattery.com/> > > "Space may be the final frontier but its made in a Hollywood basement." > - Red Hot Chili Peppers - Californication > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#36790) next »