Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100755 27 lines (20 sloc) 0.427 kB
5b3c101 created benchmark suite for object delivery and consumption
Tyler Riddle authored
1 package EventBench::Method::Array;
2
3 use strict;
4 use warnings;
5 use Benchmark ':hireswallclock';
6
7 sub receive_event {
8 my ($arg1, $arg2) = @_;
9 our($sum);
10
11 $sum += $arg1 + $arg2;
12 }
13
14 return sub {
15 my (@testData) = @_;
16 our $sum = 0;
17 my $bench;
18
19 $bench = timeit(1, sub {
20
21 foreach(@testData) {
22 receive_event($_->[0], $_->[1]);
23 }
24 });
25
26 return { bench => $bench, sum => $sum };
27 };
Something went wrong with that request. Please try again.