Title / Description
Code #!/usr/bin/perl -w use strict; use DBI; use Private::Module::SQL; use Time::HiRes qw( gettimeofday tv_interval); my $dbh = Private::Module::SQL->connect; my @ids; push @ids,int(rand(60000)) for (1..20); my @rand; push @rand,int(rand(10)) for (1..(scalar @ids)); my $t0 = [gettimeofday]; my $sth = $dbh->prepare("insert into counts (`id`, `count`) values (?,?)"); my $tuples = $sth->execute_array(undef, \@ids, \@rand); if ($tuples) { print "Successfully inserted $tuples records\n"; } print tv_interval ($t0) . "sec\n"; # why have 100 pages if i can't search them?
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code