Timer:tc

Nebmo <>
Thu Aug 24 13:55:07 CEST 2006


What is the difference between:

1:

{Time,_} = timer:tc(mod,fun,[arg]),

2:

T1 = erlang:now(),
mod:fun(arg),
T2 = erlang:now(),
Time = timer:now_diff(T2, T1),


When using them in a benchmark, timer:tc gives a number 12 times larger than erlang:now() does.
(I'm mixing hipe-code and beam-code)
_________________________________________________________
Post sent from http://www.trapexit.org



More information about the erlang-questions mailing list