PDA

View Full Version : Check the time a program requires to run


joe.pelayo
1st June 2009, 12:11 AM
Hello everybody.

I am trying to check how much time does a bash script needs to run. I know there is a command that shows the time in the command line clock, and I know that if I put one at the beginning and the end of my script I'll get the initial and final times but. can I somehow get the number or minutes (or seconds) the program runs? Perhaps a "timer" command?

Thanks.
Joe.

stelios
1st June 2009, 12:30 AM
You were quite close actually! The command is called "time".
time script.sh

joe.pelayo
1st June 2009, 06:59 AM

You were quite close actually! The command is called "time".
time script.sh
Thanks, I'll give it a shot.

Joe.