summaryrefslogtreecommitdiffstats
path: root/plugins.d/loopsleepms.sh.inc
diff options
context:
space:
mode:
authorLennart Weller <lhw@ring0.de>2017-01-24 15:21:16 +0000
committerLennart Weller <lhw@ring0.de>2017-01-24 15:21:16 +0000
commitef0c127e7f95d2db2715b9e99fe758eebc7dabd3 (patch)
treeea5d62342aba06f376f3be63aab898503b56f3ec /plugins.d/loopsleepms.sh.inc
parentupdate watch file and files-exclude (diff)
parentNew upstream version 1.5.0+dfsg (diff)
downloadnetdata-ef0c127e7f95d2db2715b9e99fe758eebc7dabd3.tar.xz
netdata-ef0c127e7f95d2db2715b9e99fe758eebc7dabd3.zip
Merge tag 'upstream/1.5.0+dfsg'
Upstream version 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 6de93043..ef3db192 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