Please sign in to comment.
Use os:timestamp/0 for elapsed time
Commit 5b056e0 replaced the deprecated erlang:now/0 with os:timestamp/0. Using the system time is the way most versions of ping work. The disadvantage of the system time is that time skew may result in a negative number. To fix this, commit c424984 used erlang:monotonic_time/1. erlang:monotic_time/1 may return negative integers and the code did not take into account sign conversions when converting the value from an erlang timestamp to binary. Revert to using os:timestamp/0 for elapsed time calculations. The other option is using signed values in the binary pattern matching. However, use of the erlang timestamp() type should probably be replaced with an 8 or 12 byte integer. Reported in: #12 Thanks @vimal7370!
- Loading branch information...