[erlang-questions] Mistake in 'timer:now_diff/2' documentation

Niclas Eklund nick@REDACTED
Thu Aug 4 13:01:13 CEST 2011


Hello!

Thanks for reporting this! Should be now_diff(T2, T1) for R14B03 as well.

Best regards,

Niclas @ Erlang/OTP

On Thu, 4 Aug 2011, Alex Morarash wrote:

> Hi all!
>
> I have noticed some diversion in R14B03 doc for timer module.
>
> In R14B02:
>
>> now_diff(T2, T1) -> Tdiff
>>    Types:
>>       T1 = T2 = {MegaSecs, Secs, MicroSecs}
>>       Tdiff = MegaSecs = Secs = MicroSecs = integer()
>>    Calculates the time difference Tdiff = T2 - T1 in microseconds, where T1 and T2 probably are timestamp tuples returned from erlang:now/0.
>
> In R14B03:
>
>> now_diff(T1, T2) -> Tdiff
>>    Types:
>>       T1 = T2 = calendar:t_now()
>>       Tdiff = integer()
>>          In microseconds
>>    Calculates the time difference Tdiff = T2 - T1 in microseconds, where T1 and T2 probably are timestamp tuples returned from erlang:now/0.
>
> According to R14B03 documentation, expression
>> timer:now_diff({0, 0, 1}, {0, 0, 2}).
> must return 1, but it returns -1.
>
> Regards,
> Aleksey Morarash,
> e-mail: tuxofil at gmail.com
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>





More information about the erlang-questions mailing list