[erlang-bugs] Annoying catch in timer:tc/3

Ulf Wiger (TN/EAB) ulf.wiger@REDACTED
Fri Mar 28 09:59:25 CET 2008


Torbjorn Tornkvist skrev:
> Why is it a catch hidden in timer:tc/3 ?
> 
> tc(M, F, A) ->
>     Before = erlang:now(),
>     Val = (catch apply(M, F, A)),        % <== ANNOYING CATCH HERE !!
>     After = erlang:now(),
>     {now_diff(After, Before), Val}.
> 
> I suggest that it is removed.
> 
> Cheers, Tobbe

Perhaps a new function then? timer:measure(M,F,A),
which doesn't catch.

BR,
Ulf W



More information about the erlang-bugs mailing list