@@ -124,8 +124,6 @@ class MQTT:
124
124
This works with all callbacks but the "on_message" and those added via add_topic_callback();
125
125
for those, to get access to the user_data use the 'user_data' member of the MQTT object
126
126
passed as 1st argument.
127
- :param bool use_imprecise_time: on boards without time.monotonic_ns() one has to set
128
- this to True in order to operate correctly over more than 24 days or so
129
127
130
128
"""
131
129
@@ -147,7 +145,6 @@ def __init__(
147
145
socket_timeout : int = 1 ,
148
146
connect_retries : int = 5 ,
149
147
user_data = None ,
150
- use_imprecise_time : Optional [bool ] = None ,
151
148
) -> None :
152
149
self ._connection_manager = get_connection_manager (socket_pool )
153
150
self ._socket_pool = socket_pool
@@ -156,20 +153,6 @@ def __init__(
156
153
self ._backwards_compatible_sock = False
157
154
self ._use_binary_mode = use_binary_mode
158
155
159
- self .use_monotonic_ns = False
160
- try :
161
- time .monotonic_ns ()
162
- self .use_monotonic_ns = True
163
- except AttributeError :
164
- if use_imprecise_time :
165
- self .use_monotonic_ns = False
166
- else :
167
- raise MMQTTException ( # pylint: disable=raise-missing-from
168
- "time.monotonic_ns() is not available. "
169
- "Will use imprecise time however only if the"
170
- "use_imprecise_time argument is set to True."
171
- )
172
-
173
156
if recv_timeout <= socket_timeout :
174
157
raise MMQTTException (
175
158
"recv_timeout must be strictly greater than socket_timeout"
@@ -245,17 +228,6 @@ def __init__(
245
228
self .on_subscribe = None
246
229
self .on_unsubscribe = None
247
230
248
- def get_monotonic_time (self ) -> float :
249
- """
250
- Provide monotonic time in seconds. Based on underlying implementation
251
- this might result in imprecise time, that will result in the library
252
- not being able to operate if running contiguously for more than 24 days or so.
253
- """
254
- if self .use_monotonic_ns :
255
- return time .monotonic_ns () / 1000000000
256
-
257
- return time .monotonic ()
258
-
259
231
def __enter__ (self ):
260
232
return self
261
233
0 commit comments