python monotonic: use CLOCK_MONOTONIC instead of CLOCK_MONOTONIC_RAW
lgz committed
Jun 1, 2018 at 17:32 UTC
20bbce31336b860af48a918046b7defd31be5ee8
1 file changed
+2
-2
python.d/python_modules/bases/monotonic.py
+2
-2
@@ -2,7 +2,7 @@
2
import ctypes
3
# import os
4
5
-CLOCK_MONOTONIC_RAW = 4 # see <linux/time.h>
5
+CLOCK_MONOTONIC = 1 # see <linux/time.h>
6
7
8
class _Timespec(ctypes.Structure):
@@ -19,7 +19,7 @@ _clock_gettime.argtypes = [ctypes.c_int, ctypes.POINTER(_Timespec)]
19
20
def time():
21
t = _Timespec()
22
- if _clock_gettime(CLOCK_MONOTONIC_RAW, ctypes.pointer(t)) != 0:
22
+ if _clock_gettime(CLOCK_MONOTONIC, ctypes.pointer(t)) != 0:
23
# errno_ = ctypes.get_errno()
24
# raise OSError(errno_, os.strerror(errno_))
25
return None