diff --git a/Bash/temposPrecis.sh b/Bash/temposPrecis.sh new file mode 100644 index 0000000..69035ea --- /dev/null +++ b/Bash/temposPrecis.sh @@ -0,0 +1,15 @@ +#/!bin/bash + +let "interval=30" +start=$(date +"%s") + +# do something + +end=$(date +"%s") +let "timeTaken=end-start" +let "timeToSleep=interval-timeTaken" +if [ $timeToSleep -gt 0 ] +then + echo "sleep for $timeToSleep sec" + sleep $timeToSleep +fi