summaryrefslogtreecommitdiffstats
path: root/plugins.d/loopsleepms.sh.inc
diff options
context:
space:
mode:
authorLennart Weller <lhw@ring0.de>2017-01-24 15:21:09 +0000
committerLennart Weller <lhw@ring0.de>2017-01-24 15:21:09 +0000
commit3ed3b02ed96ddab1c084811f3579b3a2aec83e04 (patch)
tree7a61ab288ae47800c4f11be5677d6ad8288dcd98 /plugins.d/loopsleepms.sh.inc
parentNew upstream version 1.4.0+dfsg (diff)
downloadnetdata-3ed3b02ed96ddab1c084811f3579b3a2aec83e04.tar.xz
netdata-3ed3b02ed96ddab1c084811f3579b3a2aec83e04.zip
New upstream version 1.5.0+dfsgupstream/1.5.0+dfsg
Diffstat (limited to 'plugins.d/loopsleepms.sh.inc')
-rw-r--r--plugins.d/loopsleepms.sh.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins.d/loopsleepms.sh.inc b/plugins.d/loopsleepms.sh.inc
index 6de93043c..ef3db192d 100644
--- a/plugins.d/loopsleepms.sh.inc
+++ b/plugins.d/loopsleepms.sh.inc
@@ -1,6 +1,6 @@
# no need for shebang - this file is included from other scripts
-LOOPSLEEP_DATE="$(which date)"
+LOOPSLEEP_DATE="$(which date 2>/dev/null || command -v date 2>/dev/null)"
if [ -z "$LOOPSLEEP_DATE" ]
then
echo >&2 "$0: ERROR: Cannot find the command 'date' in the system path."
@@ -139,7 +139,7 @@ loopsleepms() {
# calculate ms since last run
[ ${LOOPSLEEPMS_LASTRUN} -gt 0 ] && \
- LOOPSLEEPMS_LASTWORK=$((now_ms - LOOPSLEEPMS_LASTRUN - LOOPSLEEPMS_LASTSLEEP))
+ LOOPSLEEPMS_LASTWORK=$((now_ms - LOOPSLEEPMS_LASTRUN - LOOPSLEEPMS_LASTSLEEP + current_time_ms_accuracy))
# echo "# last loop's work took $LOOPSLEEPMS_LASTWORK ms"
# remember this run