title: How to set a timer in PHP?
body: <p>For example, my goal is to test the code given here:</p>
  
  <p><a href="https://stackoverflow.com/questions/863268/php-script-that-reports-progress-to-client">PHP script that reports progress to Client</a></p>
  
  <pre><code>&lt;?php
  
  waitalittle();
  echo 'Task one finished';
  flush();
  
  waitalittle();
  echo 'Task two finished';
  flush();
  
  ?&gt;
  </code></pre>
  
  <p>My objective is to create the waitalittle() function, which should take 5 seconds to execute.</p>
  
  <p>My final goal is to be able to view the progress of various parts of my PHP script in the browser without having to refresh. </p>
  
  <p>The issue I'm having now is that if I use any-old function instead of "waitalittle", all the echoed statements appear at the same time. I want to test the above mentioned link/answer to see if statements are echoed on the browser as they are processed. </p>