Execution time(plz Help)

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2005
Posts: 8
Reputation: warangalboy is an unknown quantity at this point 
Solved Threads: 0
warangalboy warangalboy is offline Offline
Newbie Poster

Execution time(plz Help)

 
0
  #1
Aug 6th, 2005
Hello,
How can i find the execution time of a script.
help me .
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 8
Reputation: warangalboy is an unknown quantity at this point 
Solved Threads: 0
warangalboy warangalboy is offline Offline
Newbie Poster

Re: Execution time(plz Help)

 
0
  #2
Aug 6th, 2005
im using the following script
echo "Start of script"
echo "SECONDS=$SECONDS"
echo "Sleep $2"
sleep $2
echo "SECONDS=$SECONDS"
echo "Sleep $2"
sleep $2
echo "SECONDS=$SECONDS"
echo "End Of script"
echo "SECONDS=$SECONDS"
actually i need to pass the script an argument to find the execution time
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 215
Reputation: shanenin is an unknown quantity at this point 
Solved Threads: 16
shanenin shanenin is offline Offline
Posting Whiz in Training

Re: Execution time(plz Help)

 
0
  #3
Aug 7th, 2005
I am not really following you. If you just want to know how long the script runs for in seconds. you can just place this line last in the script
Shell Scripting Syntax (Toggle Plain Text)
  1. #!/bin/sh
  2. echo $SECONDS #this line will echo 0, beciase this is the very start of the script
  3. sleep 10
  4. sleep 1
  5. echo $SECONDS #this final line echos the total execution time of the script(in seconds)
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 8
Reputation: warangalboy is an unknown quantity at this point 
Solved Threads: 0
warangalboy warangalboy is offline Offline
Newbie Poster

Re: Execution time(plz Help)

 
0
  #4
Aug 7th, 2005
Hello ,
Thanks for the reply,
I can explain it to you in this way,
the script should execute the specified script given as argument 1 ($1)
for the specified number of seconds argument 2 and must sleep for specified number of seconds given as argument 2 and must continue the cycle until argument 1 is executed.
i mean to say that
run script for $2 seconds
sleep $2
and again continue $1
until script get executed

and this must continue until argument 1 is completed.
Can you plz give me any idea for this script
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Shell Scripting
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC