Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to measure the execution time of a process that I call via the command line (i.e., I want to find out how long it takes to for the process to finish). Is there any command that I can add to the command calling the process that will achieve this?

share|improve this question

migrated from stackoverflow.com Jul 17 '11 at 12:35

This question came from our site for professional and enthusiast programmers.

3 Answers 3

date +"%T" && cp -r ./file  /destination/folder/here && date +"%T"

Running this command in the terminal will give you the total time for coping a file

share|improve this answer

You can use time:

time ls -R
share|improve this answer

Add time before the command you want to measure.

share|improve this answer
    
Thank you, that helped a lot! –  user848635 Jul 17 '11 at 12:34
1  
@ninjalj, can you provide more information on what the real, user, and sys times are that this command returns? –  Christopher Kyle Horton Jul 17 '11 at 20:22
    
from man time: Elapsed real (wall clock) time used by the process, in seconds. / Total number of CPU-seconds that the process used directly (in user mode), in seconds. / Total number of CPU-seconds used by the system on behalf of the process (in kernel mode), in seconds. –  Jacob Vlijm Aug 11 at 5:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.