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

Alex Morarash tuxofil@REDACTED
Thu Aug 4 11:55:05 CEST 2011


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



More information about the erlang-questions mailing list