How long did that command take to run?

SIMPLE ANSWER
Simply use the command time to see how long it took to execute

$> time cp -R sourcefolder targetfolder          
real 0m21.093s                                  
user 0m0.008s                                    
sys 0m0.717s                                    
 


real - is the full time it took to run the command (how long you waited).
user - is the CPU time used by the program itself.
sys - is the CPU time used by the system calls

Perhaps also see GNU time as an alternative?

Source

POWER ANSWER
Measure time of program execution and store that inside a variable
usr@srv $ mytime="$(time ( ls ) 2>&1 1>/dev/null )"
usr@srv $ echo "$mytime"

real    0m0.006s
user    0m0.001s
sys     0m0.005s
Perhaps even just use date command, and measure differences from start to finish.

START=$(date +%s.%N)
command
END=$(date +%s.%N)
DIFF=$(echo "$END - $START" | bc)
# echo $DIFF
Source: unix.stackexchange.com