in reply to Calculating query time and rows returned in SQLite
Does it matter where it spent its time, as long as you know how long it took? Because you can get a quite high resolution timestamp out of Time::HiRes, and just calculate the differences.
The array @ serves two purposes: A) it stores the time measurements in a single variable (you can always use two scalars); and B) you can use it to add intermediate time markers, for more detailed reporting.#! perl -w use Time::HiRes qw(gettimeofday); use Time::HiRes qw(sleep); # for this demo only my @t = scalar gettimeofday; sleep 3.1415926; push @t, scalar gettimeofday; printf "Total time wasted: %.3f seconds\n", $t[-1]-$t[0];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Calculating query time and rows returned in SQLite
by stonecolddevin (Parson) on Nov 17, 2006 at 00:19 UTC |