You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

13 lines
244 B

#!/bin/bash
echo >&2 "time elapsed in seconds..."
START=$(date +%s.%N)
# do something #######################
$@
#######################################
END=$(date +%s.%N)
DIFF=$(echo "scale=2; (${END} - ${START}) / 1" | bc)
echo "${DIFF}"