timer:now_diff/2 documentation inconsistency

Raimo Niskanen raimo@REDACTED
Tue Feb 28 09:19:41 CET 2006


That is a cut-and-paste documentation bug from the
function above; tc/3. The correct signature should be:

        now_diff(T2, T1) -> Tdiff

            Types
                T1 = T2 = {MegaSecs, Secs, MicroSecs}
                Tdiff = MegaSecs = Secs = MicroSecs = integer()



serge@REDACTED (Serge Aleynikov) writes:

> There seems to be a documentation discrepancy:
> 
> 
> Here's what the docs says (stdlib/timer):
> -------------------------------------------------
> now_diff(T2, T1) -> {Time, Value}
> Types:
>    T1 = T2 = {MegaSecs, Secs, MicroSecs}
>    MegaSecs = Secs = MicroSecs = integer()
> 
> Calculates the time difference T2 - T1 in microseconds, where T1 and
> T2 probably are timestamp tuples returned from erlang:now/0.
> -------------------------------------------------
> 
> 
> Here's the result type we get in the shell:
> 
> $ erl
> Erlang (BEAM) emulator version 5.4.12 [source] [hipe] [threads:0]
> 
> Eshell V5.4.12  (abort with ^G)
> 1> now().
> {1141,85623,555497}
> 2> timer:now_diff(now(), v(1)).
> 12178593
> 
> Regards,
> 
> Serge
> 
> -- 
> Serge Aleynikov
> R&D Telecom, IDT Corp.
> Tel: (973) 438-3436
> Fax: (973) 438-1464
> serge@REDACTED

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list