@@ -124,8 +124,6 @@ class MQTT:
124124 This works with all callbacks but the "on_message" and those added via add_topic_callback();
125125 for those, to get access to the user_data use the 'user_data' member of the MQTT object
126126 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
129127
130128 """
131129
@@ -147,7 +145,6 @@ def __init__(
147145 socket_timeout : int = 1 ,
148146 connect_retries : int = 5 ,
149147 user_data = None ,
150- use_imprecise_time : Optional [bool ] = None ,
151148 ) -> None :
152149 self ._connection_manager = get_connection_manager (socket_pool )
153150 self ._socket_pool = socket_pool
@@ -156,20 +153,6 @@ def __init__(
156153 self ._backwards_compatible_sock = False
157154 self ._use_binary_mode = use_binary_mode
158155
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-
173156 if recv_timeout <= socket_timeout :
174157 raise MMQTTException (
175158 "recv_timeout must be strictly greater than socket_timeout"
@@ -245,17 +228,6 @@ def __init__(
245228 self .on_subscribe = None
246229 self .on_unsubscribe = None
247230
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-
259231 def __enter__ (self ):
260232 return self
261233
0 commit comments