Time command


To measure the execution time of a command:

$ time sleep 0.5
sleep 0.5  0.00s user 0.00s system 0% cpu 0.507 total

To measure the execution time of multiple commands:

$ time (sleep 0.5 && sleep 0.5)
( sleep 0.5 && sleep 0.5; )  0.00s user 0.00s system 0% cpu 1.013 total

To measure the execution time of a script:

# echo 'sleep 61' > file.sh && chmod +x file.sh
$ time ./script.sh
./script.sh  0.00s user 0.00s system 0% cpu 1:01.00 total