I use Perl and DBI to manage my MySQL tables, queries, etc. How can I show the query execution time?
If I do SELECT in the console, the result will be like this:
+-----+-------------+ | id | name | +-----+-------------- | 1 | Jack | | 2 | Joe | | 3 | Mary | +-----+-------------+ 3 rows in set (0.17 sec)
I need to show 0.17 sec . Is there any way in DBI to show runtime in Perl, something like this?
my $dbh = $db->prepare("SELECT id, name FROM names ORDER BY id;"); $dbh->execute; print $dbh->runnin_time;
mysql perl dbi
netdjw
source share