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 .
This commit is contained in:
parent
ca5c06ef4e
commit
9f6841373d
@ -35,9 +35,13 @@ trap "rm -f $PLAIN/.gocryptfs.reverse.conf ; fuse-unmount -z $MNT ; rmdir $MNT"
|
|||||||
# Mount
|
# Mount
|
||||||
gocryptfs -q -reverse -extpass="echo test" $PLAIN $MNT
|
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 {
|
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: "
|
echo -n "LS: "
|
||||||
|
@ -20,8 +20,13 @@ fi
|
|||||||
# cd to TESTDIR
|
# cd to TESTDIR
|
||||||
cd "$1"
|
cd "$1"
|
||||||
|
|
||||||
|
# Execute command, discard all stdout output, print elapsed time
|
||||||
|
# (to stderr, unfortunately).
|
||||||
function etime {
|
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: "
|
echo -n "WRITE: "
|
||||||
|
Loading…
x
Reference in New Issue
Block a user