otp icon indicating copy to clipboard operation
otp copied to clipboard

erlang:monotonic_time(native) invalid

Open crownedgrouse opened this issue 2 years ago • 1 comments

Describe the bug Documentation of erlang:monotonic_time/1 says that argument must be of type erlang:time_unit() which includes native, but native is not allowed.

To Reproduce

17> erlang:monotonic_time(second).
-576460358
18> erlang:monotonic_time(native).
** exception error: bad argument
     in function  erlang:monotonic_time/1
        called as erlang:monotonic_time(native)
        *** argument 1: invalid time unit

Expected behavior Either documentation or function is wrong. I would expect native argument to return erlang:monotonic_time/0 value ?

Affected versions 24.3 and 25 at least.

crownedgrouse avatar Jul 23 '22 08:07 crownedgrouse

Thanks for the bug report! I've made a fix in the #6213 PR (not very well tested yet). The fix will be part of the next patch unless something unexpected happens.

rickard-green avatar Aug 10 '22 23:08 rickard-green

Fixed in patches OTP 25.0.4 and OTP 24.3.4.3 which we released today.

rickard-green avatar Aug 18 '22 19:08 rickard-green