PHP sleep() excution sequence while echoeing
<p>I have the following:</p>

<pre><code>echo time()."&lt;br&gt;";

sleep(1);
echo time()."&lt;br&gt;";

sleep(1);
echo time()."&lt;br&gt;";
</code></pre>

<p>I wrote the preceding code with intention to echo <code>time()."&lt;br&gt;"</code> ln 1,echo <code>time()."&lt;br&gt;"</code> ln 4, wait a final second and then echo the final <code>time()."&lt;br&gt;"</code>.  Altough the time bieng echoed is correct when it comes to the intervals between time(), all echo functions are echoeing after the total of the waiting period/parameters in each sleep function.</p>

<p>This is how the script runs:</p>

<ul>
<li>Excutes.</li>
<li>Waits 2 secons.</li>
<li>echoes<br>
    1275540664<br>
    1275540665<br>
    1275540666</li>
</ul>

<p>Notice the correct incrementation in <code>time()</code> being echoed.  My question is why is it not behaving like expected to where it echoes, waits a second, echoes again, waits one final second and then echos the last parameter?</p>

<p>I know my question is a little confusing due to my wording, but i will try my hardest to answer any comments regarding this, thanks.</p>
