Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tweak how we handle --stagestats.
Now, the stage name is printed *before* the stage starts, and time spent doing
it once it's done. Useful for those who can never remember the order of the
stages.
  • Loading branch information
arnsholt committed Mar 31, 2014
1 parent 368dcbe commit a2bb2db
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/HLL/Compiler.nqp
Expand Up @@ -369,6 +369,7 @@ class HLL::Compiler does HLL::Backend::Default {
}
next;
}
nqp::printfh($stderr, nqp::sprintf("Stage %-11s: ", [$_])) if nqp::defined($stagestats);
my $timestamp := nqp::time_n();
if nqp::can(self, $_) {
$result := self."$_"($result, |%adverbs);
Expand All @@ -381,7 +382,7 @@ class HLL::Compiler does HLL::Backend::Default {
}
my $diff := nqp::time_n() - $timestamp;
if nqp::defined($stagestats) {
nqp::printfh($stderr, nqp::sprintf("Stage %-11s: %7.3f", [$_, $diff]));
nqp::printfh($stderr, nqp::sprintf("%7.3f", [$diff]));
$!backend.force_gc() if nqp::bitand_i($stagestats, 0x4);
nqp::printfh($stderr, $!backend.vmstat())
if nqp::bitand_i($stagestats, 0x2);
Expand Down

0 comments on commit a2bb2db

Please sign in to comment.