php preventing max execution time limit for mail
<p>I've a script to send packages of 300-500 e-mails hour. That means that this script will be fired once a hour using cron or other feature.</p>

<p>The server has a max execution limit of 30secs and it's not configurable.</p>

<p>I've been thinking if the pseudo-code below should work:</p>

<pre><code>$time=time();
$count=0;
while(condition){
    $count++;
    send(email);
    $now=time();
    if($now-$time&gt;=29){break;} //1sec margin
}
echo "$count e-mails sent";
</code></pre>

<p>Opinions?</p>
