- 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");
- or download this
$count +=
($i > 2**2) +
...
($i > 2**26) +
($i > 2**28) +
($i > 2**30);
- or download this
do {
++$count if $i & 1;
} while $i >>= 1;