Skip to content

Instantly share code, notes, and snippets.

@zoffixznet

zoffixznet/p6.p6 Secret

Created October 14, 2017 18:41
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 zoffixznet/988071e6fb158536a35a75ef0bc88db7 to your computer and use it in GitHub Desktop.
Save zoffixznet/988071e6fb158536a35a75ef0bc88db7 to your computer and use it in GitHub Desktop.
sub measure-with ($cmd) {
qqx/$cmd @*ARGS.map("'"~*~"'")/
}
my @cmds = <perl6 ./perl6>;
my $len = @cmds».chars.max;
my $runs = 4;
my %results;
for @cmds.pick(*) -> $cmd {
%results{$cmd} = {
name => $cmd.fmt("%{$len}s"),
result => ([+] ^$runs .map: {measure-with $cmd})/$runs
};
say %results{$cmd}<name result>.Str;
}
say %results.max: *.<value>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment