Skip to content

Instantly share code, notes, and snippets.

@nekoya
Created September 24, 2010 03:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nekoya/594839 to your computer and use it in GitHub Desktop.
Save nekoya/594839 to your computer and use it in GitHub Desktop.
mysql_connect_bench.pl
use common::sense;
use Perl6::Say;
use DBI;
use Time::HiRes qw/gettimeofday tv_interval/;
my $t0 = [gettimeofday];
for (1 .. 1000) {
my $dbh = DBI->connect('dbi:mysql:database=test;host=db', 'bench', 'password') or die;
$dbh->disconnect or die;
}
my $t1 = [gettimeofday];
say tv_interval($t0, $t1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment