https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20819

--- Comment #75 from Marcel de Rooy <[email protected]> ---
use Modern::Perl;
use Data::Dumper qw/Dumper/;
use Test::More tests => 1;
use Time::HiRes qw/time/;

use t::lib::Mocks;
use t::lib::TestBuilder;

use Koha::Patron::Consents;

my $schema = Koha::Database->new->schema;
my $builder = t::lib::TestBuilder->new;

$schema->storage->txn_begin;
subtest 'myTest' => sub {
    plan tests => 2;

    # Add 1000 consents
    my $firstid;
    foreach(1..100) {
        my $consent = $builder->build_object({ class =>
'Koha::Patron::Consents' });
        $firstid = $consent->borrowernumber if !$firstid;
    }
    #my $set = Koha::Patron::Consents->search({ borrowernumber => $firstid });
    my $set = Koha::Patron::Consents->search;
    my $t1 = time;
    foreach(1..100) { my $i = $set->count; }
    my $t2 = time;
    is(1, 1, sprintf( "COUNT %6.4f\n", $t2 - $t1 ) );
    my $str = '';
    $t1 = time;
    foreach(1..100) { my $i = $set->next; $str.= $i->id; }
    #foreach(1..1000) { my $i = $set->next; #$set->_resultset->first unless $i;
}
    $t2 = time;
    is(1, 1, sprintf( "NEXT %6.4f\n", $t2 - $t1 ) );
    print "$str\n";
};
$schema->storage->txn_rollback;

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to