aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-05-08 15:03:02 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-05-08 15:03:02 +0200
commitd1cedcb2e6431e0ae7d1a1c8a6ebfc1487ac8329 (patch)
tree654bdaf790a88c4489cef7852cd545b70644eb8c
parent4298cc2332d0d0bf0ad7bc8cf186324da1d0f9c9 (diff)
downloadperlisdead-d1cedcb2e6431e0ae7d1a1c8a6ebfc1487ac8329.tar.gz
Make timing commands configurable
-rwxr-xr-xrun/benchmark16
1 files changed, 13 insertions, 3 deletions
diff --git a/run/benchmark b/run/benchmark
index ea692a1..7587ff4 100755
--- a/run/benchmark
+++ b/run/benchmark
@@ -5,10 +5,20 @@ use warnings;
my @cmd = (
q{date},
- q{perl5.32.0 -le 'print "Hello world!"'},
- q{python3.7 -c 'print("Hello world!")'},
- q{ruby26 -le 'print "Hello world!"'},
+ q{perl -le 'print "Hello world!"'},
+ q{python -c 'print("Hello world!")'},
+ q{ruby -le 'print "Hello world!"'},
);
+
+if (-f 'cfg/benchmark') {
+ open my $cfg, '<', 'cfg/benchmark'
+ or die "Could not open < cfg/benchmark: $!";
+ no strict; no warnings;
+ eval do {local $/; <$cfg>};
+ die if $@;
+ close $cfg;
+}
+
my @res;
for (1..3) {
@res = ();