ValentinBELYN / icmplib

Easily forge ICMP packets and make your own ping and traceroute.
GNU Lesser General Public License v3.0
266 stars 46 forks source link

Use monotonic time #37

Closed 5a6d311c0d8f6d1d closed 2 years ago

5a6d311c0d8f6d1d commented 2 years ago

It would be better to use monotonic time to calculate timeout in IO logic.

ValentinBELYN commented 2 years ago

Hi 👋 You are right, it will be fixed in the next version 👍

ValentinBELYN commented 2 years ago

Hi, sorry for the delay.

After reviewing the code, I realized that my choice of the time.time() function and not time.monotonic() was due to the fact that I use the result for the timeout but also within ICMPRequest and ICMPReply models.

Since the time.time() function is precise enough, I prefer to avoid calling the time.monotonic() function only for the timeout.

Thank you for your suggestion!