Skip to content

Instantly share code, notes, and snippets.

@jose-neta
Forked from mjsr/benchmark_unary_increment.pl
Last active August 29, 2015 14:19
Show Gist options
  • Save jose-neta/6e15898affbee925971d to your computer and use it in GitHub Desktop.
Save jose-neta/6e15898affbee925971d to your computer and use it in GitHub Desktop.
#!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