Timing a normal bash script

Need help with C, C++, perl, python, etc?

Timing a normal bash script

Postby open_sauce » 2007-01-08 12:10

Hi All

Is it possible to time how long it takes for a script to run?

I am running some basic backup shell scripts and would be very interested to know how long it took for each script to run.

Thanks in advance
open_sauce
 
Posts: 10
Joined: 2007-01-04 08:30

Postby marwal » 2007-01-08 12:18

time SCRIPT_NAME will work
marwal
 
Posts: 14
Joined: 2006-11-17 07:26

Postby open_sauce » 2007-01-08 12:23

Would I include that in the script?
open_sauce
 
Posts: 10
Joined: 2007-01-04 08:30

Postby open_sauce » 2007-01-08 14:17

Hi

Ok so I found this solution :


(time <your shell script>) 1> <outputfileforyourshellscript> 2>
<outputfilewhichwillcapturethetime>

Seems to work ok - wierd kinda syntax but it works.
open_sauce
 
Posts: 10
Joined: 2007-01-04 08:30


Return to Programming

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable