--- lib/A3C/SQL.pm 2008/06/21 11:01:35 218 +++ lib/A3C/SQL.pm 2008/06/22 14:55:55 220 @@ -4,9 +4,10 @@ use warnings; use base qw(Jifty::Object Class::Accessor::Fast); -__PACKAGE__->mk_accessors( qw(query arguments dbh encoding) ); +__PACKAGE__->mk_accessors( qw(query arguments dbh encoding duration) ); use Data::Dump qw/dump/; +use Time::HiRes qw/time/; =head1 NAME @@ -44,12 +45,14 @@ if ( ! $self->{_sth} ) { my $dbh = $self->dbh || Jifty->handle->dbh; my $sth = $dbh->prepare( $self->query ) or $dbh->errstr; + my $t = time(); if ( $self->arguments ) { Jifty->log->debug( $self->sql . ' arguments: ' . dump( $self->arguments ) ); $sth->execute( $self->arguments ) or die $dbh->errstr; } else { $sth->execute or die $dbh->errstr; } + $self->duration( time() - $t ); $self->{_sth} = $sth; }