title: Best method to measure execution time in Android?
body: <p>What is best method to measure execution time of Android code snippet?</p>
  
  <p>I have a section of code before and after which I want to place timestamps to find out it's execution time (e.g. one in <code>onCreate()</code> and another in <code>onDestroy()</code> method of activity).</p>
  
  <p>I have tried <code>Time.toMillies(false)</code>, but it only returns seconds to me (with constant <code>000</code> at the end). I also tried two java functions: <code>System.currentTimeMillis()</code> and <code>System.nanoTime()</code>.
  First one returns milliseconds of epoch time, second doesn't.</p>
  
  <p>What would be the best way to measure execution time and get good precision?</p>