Help for this page

Select Code to Download


  1. or download this
    my $stime = time;
    
    ...
    
    my $etime = time;
    print($etime-$stime, " seconds to count the $count 1s in 32_000_000 bi
    +ts\n");
    
  2. or download this
       $count +=
          ($i > 2**2) +
    ...
          ($i > 2**26) +
          ($i > 2**28) +
          ($i > 2**30);
    
  3. or download this
    do {
       ++$count if $i & 1;
    } while $i >>= 1;