各种有用的erlang行为
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

17 行
437 B

4 年前
4 年前
4 年前
4 年前
4 年前
4 年前
4 年前
4 年前
4 年前
4 年前
4 年前
4 年前
4 年前
  1. -module(ping1).
  2. -compile([export_all, nowarn_export_all]).
  3. call(N) ->
  4. {ok, Pid} = pong1:start(),
  5. StartTime = erlang:system_time(nanosecond),
  6. doCall(N, Pid, StartTime).
  7. doCall(0, Pid, StartTime) ->
  8. EndTime = erlang:system_time(nanosecond),
  9. exit(Pid, kill),
  10. io:format("call1 over use time: ~p ns~n",[EndTime - StartTime]);
  11. doCall(N, Pid, StartTime) ->
  12. gen_server:call(Pid, ping),
  13. doCall(N - 1, Pid, StartTime).