Bash Profiling – How to Get Execution Time of a Script Effectively

bashprofiling

I would like to display the completion time of a script.

What I currently do is –

#!/bin/bash
date  ## echo the date at start
# the script contents
date  ## echo the date at end

This just show's the time of start and end of the script. Would it be possible to display a fine grained output like processor time/ io time , etc?

Best Answer

Just use time when you call the script:

time yourscript.sh
Related Question