Using time command in bash script - Stack Overflow
#!/bin/bash
# Get time as a UNIX timestamp (seconds elapsed since Jan 1, 1970 0:00 UTC)
T="$(date +%s)"
# Do some work here
sleep 2
T="$(($(date +%s)-T))"
echo "Time in seconds: ${T}"
permalink -
-
http://stackoverflow.com/questions/3683434/using-time-command-in-bash-script