Skip to content

Instantly share code, notes, and snippets.

@cognominal
Created June 21, 2014 18:24
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 cognominal/97929bf9f94d4b67e518 to your computer and use it in GitHub Desktop.
Save cognominal/97929bf9f94d4b67e518 to your computer and use it in GitHub Desktop.
Eat a cpu to 97% on a macbook
sub MAIN($fnm) {
die unless $fnm.IO.r;
my $time = $fnm.IO.modified;
my $t = Supply.interval(1).tap(&compile-if-modified);
sleep 10000;
sub compile-if-modified($i) {
my $t1 = $fnm.IO.modified;
if $t1 > $time {
$time = $t1;
$t.close();
say "compiling $fnm";
run 'perl6', $fnm;
say "compiled";
Supply.interval(1).tap(&compile-if-modified);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment