Execution Time Bash On Linux Shell Script Timing

View previous topic View next topic Go down

Execution Time Bash On Linux Shell Script Timing

Post by jamied_uk on 23rd July 2016, 16:58




Code:
#!/bin/bash
# (c) J~Net 2016
#Usage Example ./time.sh "test.sh"
#time yourscript.sh
myvar="$@"
start=`date +%s'` # +%ms +%s

sh "$myvar"

#free
# or other commands

end=`date +%s`
runtime=$((end-start))
echo "Runtime: $runtime"



Update Files Link
app.box.com/s/dxmrui2dg6f6qc61vacshxw1frhcyte9


Last edited by jamied_uk on 23rd July 2016, 18:16; edited 1 time in total
avatar
jamied_uk
Admin

Posts : 2260
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Execution Time Bash On Linux Shell Script Timing

Post by jamied_uk on 23rd July 2016, 18:12

Time Loop

Vid


Code:
#!/bin/bash
# (c) J~Net 2016
#Usage Example ./time.sh "test.sh"
#time yourscript.sh
myvar="$@"
start=`date +%s'` # +%ms +%s

sh "$myvar"

#free
# or other commands

end=`date +%s`
runtime=$((end-start))
echo "Runtime: $runtime"
sleep 1
echo "Again?"
read -r -p "Are you sure? [Y/N] " response
if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]]
then
# Run If Yes
bash time_loop.sh "$myvar"
else
echo "Thanks For Using Time Loop!"
# clear
exit
fi
avatar
jamied_uk
Admin

Posts : 2260
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum