Sunday, 14 December 2008

Execute time of a script

How can I calculate approx. execute time of a script along with gzipping the output file?

I have given the inputfile as a commandline argument to my script.

put these lines in a file like and run as shown.

$ ./ inputfile

current=`date +%s`
cat $1 | ./ > output_`basename $1`
gzip -9 output_`basename $1`
end=`date +%s`
echo "time consumed to execute : `expr $end - $current` " | tee executetime

No comments:

Post a Comment

Tweets by @sriramperumalla