#!/bin/sh
starttime=$( /bin/date +%s )
[ ... stuff from original script ..]
stoptime=$( /bin/date +%s )
runtime=$( /bin/expr ${stoptime} - ${starttime} )
echo "Runtime: ${runtime} seconds."
#!/bin/sh
starttime=$( /bin/date +%s )
$*
stoptime=$( /bin/date +%s )
runtime=$( /bin/expr ${stoptime} - ${starttime} )
echo "Runtime: ${runtime} seconds."