Measure exection time (Bash)

Uit De Vliegende Brigade
Versie door Jeroen Strompf (overleg | bijdragen) op 31 okt 2022 om 19:25 (Nieuwe pagina aangemaakt met '* Use <code>time</code> in front of the command or call * Record time at beginning and end, and calculate the difference == Record & calculate == [https://linuxce...')
(wijz) ← Oudere versie | Huidige versie (wijz) | Nieuwere versie → (wijz)
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