Help for this page

Select Code to Download


  1. or download this
    use Benchmark;
    
    ...
                      'return_array' => sub { my @array = ret_array(); },
                      'return_ref'   => sub { my $array_ref = ret_ref(); }
                    });
    
  2. or download this
    Benchmark: timing 10000 iterations of return_array, return_ref...
    return_array: 120 wallclock secs (117.82 usr +  1.65 sys = 119.47 CPU)
    return_ref:  0 wallclock secs ( 0.03 usr +  0.00 sys =  0.03 CPU)