Re: [sqlite] Is there a way to measure query time in sqlite at runtime?

2012-11-17 Thread Simon Slavin
On 16 Nov 2012, at 11:26pm, 杨苏立 Yang Su Li wrote: > I want to measure the execution time of each sql statement in sqlite. > > I understand in sqlite shell you could just do .timer on, but I am > wondering how to do it in a pogrammerable way so that I could know how much > time a sql statement t

Re: [sqlite] Is there a way to measure query time in sqlite at runtime?

2012-11-17 Thread kyan
On Sat, Nov 17, 2012 at 1:26 AM, 杨苏立 Yang Su Li wrote: > I want to measure the execution time of each sql statement in sqlite. Use sqlite3_profile() to register a profiler callback for a database connection that will be called for every SQL statement you execute on that connection. http://www.sq

[sqlite] Is there a way to measure query time in sqlite at runtime?

2012-11-17 Thread 杨苏立 Yang Su Li
I want to measure the execution time of each sql statement in sqlite. I understand in sqlite shell you could just do .timer on, but I am wondering how to do it in a pogrammerable way so that I could know how much time a sql statement takes when applications are accessing the database at real time,