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

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