Help for this page

Select Code to Download


  1. or download this
    use Time::HiRes qw(time);
    
    ...
    my $t2 = time;
    printf "time = %.3f; secs per 1M keys: %.3f\n",
        ($t2-$t1), ($t2-$t1) / $n * 1_000_000;
    
  2. or download this
    $ perl foo 1000000
    time = 0.400; secs per 1M keys: 0.400
    ...
    time = 3.792; secs per 1M keys: 0.474
    $ perl foo 16000000
    time = 9.213; secs per 1M keys: 0.576