concurrency - measuring concurent loop times in erlang -


I am creating a round of processes in erlang and want to measure the time that the message was taken for the network To get messed up and send back the entire message chain, the first node message every time, it sends the second one, right now in the first node I have the following code:

  received stop-> gt; ; Io: Format ("All processes are closed! ~ N"), true; Start & gt; Statistics (runtime), son! {Number, 1}, msg (PID, son, M, 1); {_, M} - & gt; {Time 1, _} = data (runtime), IO: format ("last message ~ p! ~ N", [Time 1 * 1000] has come after, son!  

Of course, I start the data when I send the first message. As you can see that I use TimeSense_Last for the message loop for the first time and want to use the total_timetime for the whole run, the problem is that the total_timetime is accumulated Because I start the data for the first time. I think that The other idea I'm using another process is to get 2 loops each time to get them to add and print but I'm sure erlang can do better than this. I think it's best to fix The way, the total_timetime is flushed, but I do not know how it can be done. How can this deal with any idea? Measurement of round-trip time One way is to send a timestamp with each message.

When the first node receives the message, So it can measure the time of round-trip, calculates Total_Run_Time - timestamp .

To calculate the total run time, I remember the timestamp for the first time in the process state (or dictionary), and calculate the total run time while pausing the exam.

In addition to this, when you mention the network, are you sure that the CPU time (which is the data that runs on the runtime), what are you doing? Perhaps, Wall clock time will be more appropriate.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -