Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 32 lines (24 sloc) 0.541 kb
package EventBench::ObjectMethod::Array;
use strict;
use warnings;
use Benchmark ':hireswallclock';
sub new {
return bless({}, $_[0]);
}
sub receive_event {
my ($self, $arg1, $arg2) = @_;
our $sum;
$sum += $arg1 + $arg2;
}
return sub {
my (@testData) = @_;
my $test = EventBench::ObjectMethod::Array->new;
our $sum = 0;
my $bench;
$bench = timeit(1, sub {
foreach(@testData) {
$test->receive_event($_->[0], $_->[1]);
}
});
return { bench => $bench, sum => $sum };
};
Jump to Line
Something went wrong with that request. Please try again.