calling timer_interval from module

Wes James <>
Fri Apr 30 19:57:02 CEST 2010

If I have:



start() ->
	timer:apply_interval(3000, gpc, getc, []).

getc() -> "yep".

when I run:


I get the error:

=ERROR REPORT==== 30-Apr-2010::11:39:15 ===
Error in process <0.70.0> with exit value: {undef,[{gpc,getc,[]}]}

If I change -export to:

-export([start/0, getc/0]).

If I run:

{ok,R}=timer:apply_interval(3000, gpc, getc, []).

I get


but nothing ever happens.

If I do the same thing with:



tst_fun() ->
	io:format("~n~w~n", [erlang:localtime()]).


It works??

Any idea why the first doesn't work?

The difference is running timer:apply_interval from the cli vs from
inside a module, it looks like.



More information about the erlang-questions mailing list