Re: [PHP] sleep and usleep not working ??
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"" [EMAIL PROTECTED] skrev i en meddelelse 94m72k$qd9$[EMAIL PROTECTED]">news:94m72k$qd9$[EMAIL PROTECTED]... ""Benny Nissen"" [EMAIL PROTECTED] wrote in message 94k0ql$em$[EMAIL PROTECTED]">news:94k0ql$em$[EMAIL PROTECTED]... 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General 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] sleep and usleep not working ??
""Benny Nissen"" [EMAIL PROTECTED] wrote in message 94k0ql$em$[EMAIL PROTECTED]">news:94k0ql$em$[EMAIL PROTECTED]... 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] sleep and usleep not working ??
I have to add that I am using the latest PHP version. It was Windows and Linux servers I was talking about. usleep work in the way that it return right away without any sleep time. Benny ""Benny Nissen"" [EMAIL PROTECTED] skrev i en meddelelse 94k0ql$em$[EMAIL PROTECTED]">news:94k0ql$em$[EMAIL PROTECTED]... 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); } It turns out that the sleep and usleep does not return as far as I can tell. If I use usleep the wait time parameter have no affect on program execution ?? Tried this on both Windows and Linux. Benny -- PHP General 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] -- PHP General 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]