From d1cedcb2e6431e0ae7d1a1c8a6ebfc1487ac8329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sat, 8 May 2021 15:03:02 +0200 Subject: Make timing commands configurable --- run/benchmark | 16 +++++++++++++--- 1 file 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 = (); -- cgit v1.2.3