I have the following script. When it runs it prints the Start and end Times to the file 'result.txt'.
However, I also want to record the total runtime (end-start), but where I am doing echo runtine at the end, it just returns runtime: with nothing recorded next to it. Am I doing something incorrect?
#!/bin/bash
clear
echo "Test 001" > result.txt
echo "start time: " $(date +%T) >> result.txt
start=`date +%s`
#DO STUFF HERE
end=`date +%s`
echo "end time: " $(date +%T) >> result.txt
runtime=$((end-start))
echo "runtime: " $(runtime) >> result.txt
echo " - - - "

