[erlang-questions] signal arrival time

Joe Armstrong erlang@REDACTED
Wed May 2 11:40:34 CEST 2012


Yes - read the manual pages for the BIF erlang:trace.  You basically
set up a trace process
that watches the process you are interested in, then you ask the
system to send you timestamp
information for each message that is received.

This is described at http://www.erlang.org/doc/man/erlang.html#trace-3

Alternatively you could you fold something like this into your code:


      loop() ->
            receive
                 {ts, Time, Pattern1} ->
                        ...
                 {ts, Time, Pattern2} ->
                        ...
                 Any ->
                        self() ! {ts, erlang:now(), Any},
                        loop()
             end.

/Joe


On Wed, May 2, 2012 at 5:24 AM, József Bérces
<jozsef.berces@REDACTED> wrote:
> Is there a way to tell the time when a signal arrived to the process
> mailbox?
>
> Thanks,
> Jozsef
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list