December 4, 2024

Quickly Measure Time Taken By Applications To Execute Using Linux Mint / Ubuntu Terminal

Time taken to execute pwd command from terminal

Here is a useful Terminal command in Linux Mint / Ubuntu to measure how much time it takes to execute any command or application :

In Terminal window, simply type  time <command/application whose execution time needs to be measured>:

Examples :

time pwd

Time taken to execute pwd command from terminal

time ls

Time taken to execute ls command from terminal

time gedit

Time taken for gedit to execute from terminal

The output displays the time as the actual or real time taken for the command to start and stop, the time from user end and finally from the system end. One thing to remember when using the time command is that it acts like a stopwatch which means it displays the total time for any command or application from it’s launch to it’s exit.

In the above examples, highest time was taken by gedit (which is a graphical text editor) not because it is run like other commands like ls and pwd but because it was closed manually instead of the terminal based commands which complete on their own.

This is a useful way to check if say certain automated programs appear to be very slow in executing or in overall usage, like on the server end where there are many jobs in the queue and are taking longer then expected or scripts not appearing to run normally as they are used to.

For a very detailed usage, do check out the man page for time by typing the following in Terminal :

man time

Cheers.

 

 

By admin

Related Post

One thought on “Quickly Measure Time Taken By Applications To Execute Using Linux Mint / Ubuntu Terminal”
  1. Do you know how to get time to automatically end the program? For instance, “time gimp” leaves the app open and waits for the user to exit it.

Comments are closed.