I am writing a script in bash to calculate the time elapsed for the execution of my commands, consider:
STARTTIME=$(date +%s) #command block that takes time to c
Try the following code:
start=$(date +'%s') && sleep 5 && echo "It took $(($(date +'%s') - $start)) seconds"