
increment benchmark
By: a guest on
May 25th, 2012 | syntax:
Perl | size: 0.18 KB | hits: 23 | expires: Never
#!/usr/bin/perl
use strict;
use warnings;
use Benchmark ':all';
my $i = 0;
timethis(
30000000,
sub { ++$i }
);
$i = 0;
timethis(
30000000,
sub { $i++ }
);