title: TimerTask vs Thread.sleep vs Handler postDelayed - most accurate to call function every N milliseconds?
body: <p>What is the most accurate way to call a function every N milliseconds?</p>
  
  <ul>
  <li>Thread with Thread.sleep</li>
  <li>TimerTask</li>
  <li>Handler with postDelayed</li>
  </ul>
  
  <p>I modified <a href="http://www.javacodegeeks.com/2011/07/android-game-development-game-loop.html">this example</a> using Thread.sleep and it's not very accurate.</p>
  
  <p>I'm developing a music app that will play sounds at a given BPM.  I understand it's impossible to create an entirely accurate metronome and I don't need to - just looking to find the best way to do this.</p>
  
  <p>Thanks</p>