infinite loop keeps my page loading
<p>I have a function that is supposed to be an infinite function, but when I start it it keeps loading. in this case he keeps going around 70-79 seconds while I have specified 21 in <code>set_time_limit</code>.</p>

<p>When I start it doesn't do anything and when those 75 seconds are done it suddenly display 8 times the date difference. all at once. I want it to display my text every 1 second and without lagging for 1 hour long
all my values below are lower then the numbers I said above because I thought that 1 second would maybe to fast but it still lags for 10 seconds</p>

<pre><code>set_time_limit (21);
// 21 seconds until its done should become an hour later
// this was to test 
$x=1;
$startTime = time();
$timeout = 10;   //timeout in seconds
for ($i=0;;$i++)
{
   if(time() &gt; $startTime + ($x * $timeout)) {

     $x++;
     $today=date('d-m-Y H:i:s');
     echo "it's now: ". $today . "&lt;/br&gt;";
     $newyear = date('d-m-Y H:i:s', mktime(0, 0, 0, 01, 01, 2013));
     $difference=get_datediff_string($vandaag,$nieuwjaar); 
     // get_datediff_string() is defined somewhere below,
     // but wasn't worth to show it.
     echo "it is $difference untill newyear"; 

   }
}
</code></pre>
