[erlang-questions] Calculate nanoseconds

Jesper Louis Andersen jesper.louis.andersen@REDACTED
Sat Nov 21 16:23:38 CET 2015


You can adapt the source code of timer:tc/1 to use nano_seconds timing
rather than microseconds, but I would be weary you can get accurate timing
at the nanosecond scale by running a single experiment. You would have to
run more rounds and divide in order to figure out what a real timing would
be.

Also, you should collect many samples, and do bootstrapping on the dataset
in order to figure out if the average is a stable number, or if it is
likely to have been perturbed by something.


On Sat, Nov 21, 2015 at 8:23 AM, Felix Gallo <felixgallo@REDACTED> wrote:

> http://www.erlang.org/doc/man/timer.html#tc-1
>
> Is a good place to start.
>
> F.
> On Nov 20, 2015 11:18 PM, "Benjamin Adams" <ben@REDACTED> wrote:
>
>> Hello,
>>
>> How would I go about calculating Nanoseconds for a function call.  Want
>> to use it for language profiling.
>>
>> Time.start()
>> Fun() ->......
>> Receive
>> Io:format("nanoseconds: ~p", [Time.stop()]),
>> End.
>>
>> Something like that.
>>
>> -----
>> Ben Adams
>>
>> _______________________________________________
>> erlang-questions mailing list
>> erlang-questions@REDACTED
>> http://erlang.org/mailman/listinfo/erlang-questions
>>
>>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>


-- 
J.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20151121/02923df6/attachment.htm>


More information about the erlang-questions mailing list