Execution Time Bash On Linux Shell Script Timing
Page 1 of 1
Execution Time Bash On Linux Shell Script Timing
- 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
Re: Execution Time Bash On Linux Shell Script Timing
Time Loop
Vid
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
Similar topics
» Make linux bash dot sh file executable shell script
» Linux Bash Shell Script To Pick A Random Number From And To Range
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» Using Linux Play Synth Bash Shell Scripting
» Linux Bash Dog Age Calculator Script
» Linux Bash Shell Script To Pick A Random Number From And To Range
» Linux BASH Script Running Commands and Functions From Bash Script and saving to varables
» Using Linux Play Synth Bash Shell Scripting
» Linux Bash Dog Age Calculator Script
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum