A basic while loop
my $N = 100000; my $i = 0; my $j = 0; # start timer while $j < $N { $i = $i + $j; $j = $j + 1; } # stop timer
Results (seconds):
2011.01 Perl 5.14 while 0..^N 23.04 0.02
Rakudo Perl 6 | A Rakudo Performance | #5 |
my $N = 100000; my $i = 0; my $j = 0; # start timer while $j < $N { $i = $i + $j; $j = $j + 1; } # stop timer
Results (seconds):
2011.01 Perl 5.14 while 0..^N 23.04 0.02
Copyright © 2012 http://www.pmichaud.com/2012/pres/ |