summaryrefslogtreecommitdiff
path: root/benchmark-reverse.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2017-02-16 19:01:24 +0100
committerJakob Unterwurzacher2017-02-16 19:01:24 +0100
commit9f6841373d539b0cf04b78e0ec520e9c66c6b3c1 (patch)
tree2e921aa07a243353af2e2a1c2b93e614560a36e3 /benchmark-reverse.bash
parentca5c06ef4e40af957cbb1ccaa3aae9baa843267e (diff)
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 .
Diffstat (limited to 'benchmark-reverse.bash')
-rwxr-xr-xbenchmark-reverse.bash8
1 files changed, 6 insertions, 2 deletions
diff --git a/benchmark-reverse.bash b/benchmark-reverse.bash
index 2cb1e94..3e50a62 100755
--- a/benchmark-reverse.bash
+++ b/benchmark-reverse.bash
@@ -35,9 +35,13 @@ trap "rm -f $PLAIN/.gocryptfs.reverse.conf ; fuse-unmount -z $MNT ; rmdir $MNT"
# Mount
gocryptfs -q -reverse -extpass="echo test" $PLAIN $MNT
-# Print elapsed wall time only
+# 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 "LS: "