#!/bin/bash START=$(date +%s.%N) eval -- "$*" END=$(date +%s.%N) DIFF=$(echo "scale=6; (${END} - ${START}) / 1" | bc) printf -- "-----------------\nelapsed seconds = %f\n" "${DIFF}" >&2