SimpleService: use local monotonic time func instead of built-in (py2)
lgz committed
Jun 1, 2018 at 14:25 UTC
c0aaebfbc257d89c49c5ad249d4699e22cd68e23
1 file changed
+5
-2
python.d/python_modules/bases/FrameworkServices/SimpleService.py
+5
-2
@@ -4,11 +4,14 @@
4
# Author: Ilya Mashchenko (l2isbad)
5
6
from threading import Thread
7
+from time import sleep
8
9
try:
9
- from time import sleep, monotonic as time
10
+ from time import monotonic as time
11
except ImportError:
11
- from time import sleep, time
12
+ from bases.monotonic import AVAILABLE, time
13
+ if not AVAILABLE:
14
+ from time import time
15
16
from bases.charts import Charts, ChartError, create_runtime_chart
17
from bases.collection import OldVersionCompatibility, safe_print