Skip to content

Instantly share code, notes, and snippets.

@peczenyj
Created April 15, 2014 17:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peczenyj/10749501 to your computer and use it in GitHub Desktop.
Save peczenyj/10749501 to your computer and use it in GitHub Desktop.
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;
$ 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