Created
June 28, 2010 18:27
-
-
Save zts/456184 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
[zstevens@zts-mbp ~]$ time perl -e 'my $x; my $block = sub { $x=1; }; for (1..1000000) { &$block; };' | |
real 0m0.398s | |
user 0m0.386s | |
sys 0m0.006s | |
[zstevens@zts-mbp ~]$ time perl -e 'my $x; my $block = sub { $x=1;$x=1;$x=1;$x=1;$x=1;$x=1;$x=1;$x=1;$x=1;$x=1; }; for (1..100000) { &$block; };' | |
real 0m0.118s | |
user 0m0.108s | |
sys 0m0.005s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It proves how useful is to write numbers using underscore, cause I didn't see at first mom that the number of iterations were different.