tools to measure the time taken by a set of commands
This commit is contained in:
parent
9f33bfd50f
commit
3159e18512
2 changed files with 13 additions and 0 deletions
8
mtime.sh
Executable file
8
mtime.sh
Executable 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
5
repeat.sh
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
max=$1; shift;
|
||||
for ((i=1; i <= max ; i++)); do # --> C-like syntax
|
||||
eval "$@" &>/dev/null;
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue