kuljis.xyz

Measuring execution time in SQLite

Feb 12, 2025

82 words

Today I learned how to measure query execution times in SQLite.

All you have to do is enable the .timer command.

Example

sqlite> .timer on
sqlite> select id, title from categories;
Run Time: real 0.001 user 0.000160 sys 0.00008

Real vs User vs System Time

Real Time (Wall Clock Time)

Real time is the total elapsed time from the moment I started the command until it finished.
This includes cpu time, waiting for i/o, sleep time.

  1. User time is cpu time spent in user mode