This will only answer one part of the question (the most unhelpful part, unfortunately).
I googled this up because I was looking for something to time queries and the sqlite3 client has a timer meta command.
sqlite> .timer on
from there on in, all query results will have cpu timer statistics appended.
Hope this helps at least a little bit.