how to find out the execution time of Sqlite query in android

android, android-sqlite, performance

Solution

You could do this in Java:

int startTime = System.currentTimeMillis();

... // Execute the query here

int executionTime = System.currentTimeMillis() - startTime; // This variable now contains the time taken by the query, in milliseconds

Problem

I'm trying to optimize the performance of my Sqlite queries. I wanted to know if there is any way to find the execution time of each Sqlite statement, or if there is any tool that allows to view the statement execution time in Android SDK? Although I'm familiar with `.timer On` and `.timer show` commands for Query timer. Example: Any answer is truly appreciated!

Original source

Related problems