-
-
Save peczenyj/10749501 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
use strict; | |
use warnings; | |
use feature 'say'; | |
use Memory::Stats; | |
sub multiplicador{ | |
my @ini = (100..999); | |
my $fim = 999; | |
my @memo; | |
while ($fim != 100){ | |
foreach (@ini){ | |
my $m = $_ * $fim; | |
push (@memo, $m); | |
} | |
$fim--; | |
} | |
scalar @memo; | |
} | |
my $stats = Memory::Stats->new; | |
$stats->start; | |
say multiplicador(); | |
$stats->stop; | |
$stats->report; |
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
$ perl a.pl | |
809100 | |
--- Memory Usage --- | |
start: 7151616 | |
stop: 35123200 - delta: 27971584 - total: 27971584 | |
--- Memory Usage --- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment