title: PHP Sleep Function (Email Throttling) Freezes Entire Server
body: <p>I am on a standard shared Hostgator which has a limit of 500 mails per hour.</p>
  
  <p>I am trying to throttle my email script to only send 1 email per 8 seconds...</p>
  
  <pre><code>$query=mysql_query("SELECT email FROM users WHERE verified='1' ORDER BY balance DESC");
  while($arr=mysql_fetch_array($query)){
  set_time_limit(30);
  $mail-&gt;AddAddress($arr[0]);
  $mail-&gt;Send();
  $mail-&gt;ClearAddresses();
  echo "Sent to ".$arr[0]."&lt;br&gt;&lt;br&gt;";
  sleep(8);
  }
  </code></pre>
  
  <p>I am using PHPMailer. The script itself works fine, it emails once every 8 seconds...</p>
  
  <p>But the rest of the domain freezes up completely. </p>
  
  <p>Is there an alternative method of sleeping I can use that won't freeze up my whole domain?</p>
  
  <p>Thanks :)</p>