title: Log query time in SQLite on Android
body: <p>Is there a way to log the duration of all queries performed on an SQLite database within an Application?</p>
  
  <p>I have an application with a large database and I would like to get some insight into the time a query takes to be execute, and the time that the database is locked in a transaction.</p>
  
  <p>Something like:</p>
  
  <pre><code>[10ms] select * from users where user_id = 10
  [122ms] select * from users
  </code></pre>
  
  <p>I'm not looking to run 'explain' to identify potentially slow queries, I'd like to see how long queries are taking on a real device and find out if queries are being blocked from execution because another thread has locked the database.</p>
  
  <p>The SQLiteDatabase class is final, so I could write a wrapper to manage the logging, but I was wondering if this has already been done or if there is a better approach.</p>
  
  <p>The logging is only required during development. I am not interested in using this in a production environment.</p>