Help for this page

Select Code to Download


  1. or download this
    $w[$_] = int rand(20) foreach (0..$max);
    
  2. or download this
    $ perl bench_sort.pl
    Benchmark: timing 80 iterations of merge, quick...
    ...
    Benchmark: timing 80 iterations of merge, quick...
         merge:  4 wallclock secs ( 3.76 usr +  0.00 sys =  3.76 CPU) @ 21
    +.28/s (n=80)
         quick: 10 wallclock secs (10.65 usr +  0.00 sys = 10.65 CPU) @  7
    +.51/s (n=80)
    
  3. or download this
    $w[$_] = int rand(10) foreach (0..$max);
    
  4. or download this
    $ perl bench_sort.pl
    Benchmark: timing 80 iterations of merge, quick...
         merge:  4 wallclock secs ( 3.76 usr +  0.00 sys =  3.76 CPU) @ 21
    +.28/s (n=80)
         quick: 22 wallclock secs (22.48 usr +  0.00 sys = 22.48 CPU) @  3
    +.56/s (n=80)
    
  5. or download this
    my $max = 4999;
    $w[$_] = int rand(10) foreach (0..$max);