added total time elapsed

This commit is contained in:
George Danchev 2011-06-26 15:16:10 +00:00
parent c7eba497f9
commit 82998070d8
1 changed files with 14 additions and 3 deletions

View File

@ -10,22 +10,33 @@ CLOG2=log.$SELF.2
> ${CLOG2} > ${CLOG2}
main() { main() {
#
DSTART=`date --utc`
printf "\n$0: Started at ${DSTART}"
E1=`date '+%s'`
# avoid running (your)self # avoid running (your)self
for s in `ls | grep -v ${SELF}`; do for s in `ls | grep -v ${SELF}`; do
if [ -x ${s} ]; then if [ -x ${s} ]; then
set +e set +e
printf "\n$0: running ${s}..." printf "\n$0: Running ${s}..."
# -rc -clean are shared options amongst the all releng scripts # -rc -clean are shared options amongst the all releng scripts
T1=`date '+%s'` T1=`date '+%s'`
./${s} -rc -clean 1>>${CLOG1} 2>>${CLOG2} ./${s} -rc -clean 1>>${CLOG1} 2>>${CLOG2}
RET=$? RET=$?
T2=`date '+%s'` T2=`date '+%s'`
let TS="${T2}-${T1}" let TS="${T2}-${T1}"
printf "done. return code: $RET; time spent: ${TS}." printf "done. ret: $RET; time: ${TS} sec."
set -e set -e
fi fi
done done
printf "\n\n\t$0: *** inspect ${CLOG1} and ${CLOG2} ***\n\n"
DEND=`date --utc`
printf "\n$0: Finished at ${DEND}"
E2=`date '+%s'`
let ES="${E2}-${E1}"
printf "\n$0: Total time elapsed ${ES} sec."
printf "\n$0: *** Inspect ${CLOG1} and ${CLOG2} ***\n\n"
exit 0 exit 0
} }