This repository has been archived on 2025-08-18. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
GGS/tests/tick.erl
2011-03-06 05:25:35 +01:00

26 lines
375 B
Erlang

-module(tick).
-export([start/0]).
start() ->
spawn(fun() -> loop() end).
loop() ->
receive
tick ->
erlang:display("tick!"),
timer:send_after(500, tick),
loop();
'EXIT' ->
exit(normal)
end.
% 1> c(tick).
% {ok,tick}
% 2> Pid = tick:start().
% <0.38.0>
% % Nothing happens :-(
% When I send it myself then it responds
% 3> Pid ! tick.
% tick
% 5>