Skip to content

Instantly share code, notes, and snippets.

@zts
Created June 28, 2010 18:27
Show Gist options
  • Save zts/456184 to your computer and use it in GitHub Desktop.
Save zts/456184 to your computer and use it in GitHub Desktop.
[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
@wreis
Copy link

wreis commented Jun 29, 2010

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment