LINUX – bash time diff script

date11=$(date +"%s")
# do stuff here that your timing
date22=$(date +"%s")
diff11=$(($date22-$date11))
echo "$(($diff11 / 60)) minutes and $(($diff11 % 60)) seconds elapsed."

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *