From 504576a88782de24fbcb0ded473426411001ed77 Mon Sep 17 00:00:00 2001 From: chteufleur Date: Tue, 18 Aug 2015 16:08:39 +0200 Subject: [PATCH] Add Bash tempos precis snippet --- Bash/temposPrecis.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Bash/temposPrecis.sh 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