Measure exection time (Bash)

Uit De Vliegende Brigade
Naar navigatie springen Naar zoeken springen
  • Use time in front of the command or call
  • Record time at beginning and end, and calculate the difference

Record & calculate

[1]:

start=`date +%s`

...

end=`date +%s`
echo Execution time was `expr $end - $start` seconds.

Sources