#!/usr/bin/perl
#
# eg16: second benchmarking test: compare two algorithms..
#

use strict;
use warnings;
use Benchmark qw(:all);
my $duration = shift @ARGV || 4;

timethese( -$duration, 		# run for at least duration CPU seconds
{
	'x++'  => sub { my $x = 100; $x++ },
	'x+=1' => sub { my $x = 100; $x += 1 },
});
