title: Periodic Callback in c
body: <p>I am a newbie writing code for sound playback via "alsa api".</p>
  
  <p>I have to repeatedly call a function <code>send_output()</code> 10 times in a sec as:</p>
  
  <pre><code>while(true)
  {
       send_output();
       usleep(100000);
  }
  </code></pre>
  
  <p>but this is a bad way of programming since within the <code>usleep()</code> function processor is still busy executing the code.</p>
  
  <p>I want to know the way (for I know it exists) to put the function <code>send_output()</code> into a periodic callback function so that in between the calls, the processor can be kept free for other heavy tasks. Can you help me?</p>
  
  <p>P.S. I am programming on 'Beagleboard' which has a very low clock rate and need to do other tasks too.</p>
  
  <p>Thanks.</p>