You might want to take a look at DBI::Profile.
In reply to Re: timing response from database by adrianh in thread timing response from database by perlknight