我尝试将相应的线程与时间戳(从现在开始的微秒数函数)匹配,就像 *jill从john [739000]收到介绍消息**和john从jill [739000]收到回复消息 *
if
I == true ->
M_pid!{lists:concat([Self_name," received intro message from ", Process_name , "[",erlang:now(),"]"]), self()},
%io:fwrite(I),
whereis(Process_name)!{Self_name, "reply",self()},
friends(Msg, M_pid, State + 1, Self_name);
R == true ->
M_pid!{lists:concat([Self_name," received reply message from ", Process_name , "[",pid_to_list(Process_id),"]"]), self()},
friends(Msg, M_pid, State + 1, Self_name)
end
我试着从process_id
改到微秒从now()
。我是一个新手到厄兰。提前感谢大家!
1条答案
按热度按时间ehxuflar1#
erlang:now()
is deprecated and should NOT be used. There are two options to get current time in microsecondsos:timestamp()
os:system_time(microseconds)