Created
June 20, 2014 09:33
-
-
Save mjsr/c93f4f7f34ebf7bcfd3d to your computer and use it in GitHub Desktop.
Benchmark unary increments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use warnings; | |
use strict; | |
use Benchmark qw( timethese ); | |
my ( $preinc, $postinc ) = ( 0, 0 ); | |
timethese(100_000_000, { | |
'use_preinc' => sub { ++$preinc; }, | |
'use_postinc' => sub { $postinc++; }, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks guys :)