how to use timer:apply_interval/4

Oscar ro4tub@REDACTED
Sun Jul 19 06:01:10 CEST 2009


  1 #!/usr/bin/env escript
  2
  3 do_task(A) ->
  4     io:format("~w: now=~w~n", [A, now()]).
  5
  6 main(_) ->
  7     io:format("starting \n"),
  8     {ok, _} = timer:apply_interval(80, ?MODULE, do_task,["info"]),
  9     timer:sleep(100),
 10     io:format("ending \n").



hkf@REDACTED:~/work/erlang/flower$ ./timer_main.erl
./timer_main.erl:3: Warning: function do_task/1 is unused
starting

=ERROR REPORT==== 19-Jul-2009::11:57:29 ===
Error in process <0.33.0> with exit value:
{undef,[{'escript__timer_main.erl__1247__975849__641609',do_task,["info"]}]}

ending




I have two questions:
1. how to explain the error log?
2. how to get rid of the warning ''function do_task/1 is unused'?


More information about the erlang-questions mailing list