Bash: add stopwatch function