tools to measure the time taken by a set of commands

This commit is contained in:
nojhan 2012-08-11 11:32:36 +02:00
commit 3159e18512
2 changed files with 13 additions and 0 deletions

8
mtime.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
max=$1
while read -r line; do
echo -ne $( (/usr/bin/time -f "%U+%S" ./repeat.sh $max $line ) 2>&1 | bc )
echo -e "\t$line"
done

5
repeat.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
max=$1; shift;
for ((i=1; i <= max ; i++)); do # --> C-like syntax
eval "$@" &>/dev/null;
done