From 9f6841373d539b0cf04b78e0ec520e9c66c6b3c1 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 16 Feb 2017 19:01:24 +0100 Subject: benchmarks: OSX compat: replace /usr/bin/time with bash builtin On OSX, /usr/bin/time does not support "-f". Reported in https://github.com/rfjakob/gocryptfs/issues/15#issuecomment-279130217 . --- tests/canonical-benchmarks.bash | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/canonical-benchmarks.bash b/tests/canonical-benchmarks.bash index b7c2d38..1a5bf3a 100755 --- a/tests/canonical-benchmarks.bash +++ b/tests/canonical-benchmarks.bash @@ -20,8 +20,13 @@ fi # cd to TESTDIR cd "$1" +# Execute command, discard all stdout output, print elapsed time +# (to stderr, unfortunately). function etime { - LC_ALL=C /usr/bin/time -f %e 2>&1 $@ > /dev/null + # Make the bash builtin "time" print out only the elapse wall clock + # seconds + TIMEFORMAT=%R + time "$@" > /dev/null } echo -n "WRITE: " -- cgit v1.2.3