Re: Behavior of the sleep function?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeffry Killen wrote:

> On Mar 10, 2015, at 1:46 PM, Christoph Becker wrote:
> 
>> I just found <http://www.tuxradar.com/practicalphp/8/11/0>, where a very
>> simplistic example of flock() in combination with sleep() is given.
>>
>> Please don't forget to "reply to all" next time.
> 
> O.K. I looked at the link and that is essentially what my code is trying
> to do:
> I.E. obtain a lock, print some text and then call sleep. But the text that
> is supposed to be returned before the call to sleep() doesn't show up
> until the first query is done, then the second query returns (with, as you
> indicated, adding a call to flock in the second query handling code.)
> 
> That is why I presumed that sleep() was using output buffering.

Ah, now I understand.

Anyhow, sleep() does not use output buffering or has anything to do with
it.  If formerly printed output is not send to the browser, that is
either caused by PHP[1] or by the webserver.  You can try to flush()[2]
the output before calling sleep().

[1] <http://php.net/manual/en/outcontrol.configuration.php>
[2] <http://php.net/manual/en/function.flush.php>

-- 
Christoph M. Becker


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux