fork download
  1. -module(prog).
  2. -export([main/0, q/1]).
  3.  
  4. q(Count) when Count =< 0 -> ok;
  5. q(Count) ->
  6. io:format("~w~n", [erlang:monotonic_time()]),
  7. receive Pid -> Pid ! self() end,
  8. q(Count - 1).
  9.  
  10. main() ->
  11. Pid = spawn_link(prog, q, [5]),
  12. Pid ! Pid,
  13. timer:sleep(1000).
Success #stdin #stdout 0.12s 19456KB
stdin
Standard input is empty
stdout
-576460751861133531
-576460751854473326
-576460751854446013
-576460751854425971
-576460751854409101