Help for this page

Select Code to Download


  1. or download this
    Benchmark: timing 1000000 iterations of tin1, tin2, tin3...
          tin1:  1 wallclock secs ( 0.59 usr +  0.00 sys =  0.59 CPU) @ 16
    +86340.64/s (n=1000000)
    ...
    tin3  450450/s   -- -66% -73%
    tin2 1333333/s 196%   -- -21%
    tin1 1686341/s 274%  26%   --
    
  2. or download this
    $results = timethese(1000000,{
    tin1 => '$output[int($_/3)] += $arr[$_] for 0..@arr-1;',
    ...
    }
    '});
    Benchmark::cmpthese( $results );