Macros to use :timer.apply_after and :timer.apply_interval with a block, e.g.:
iex(1)>importBlockTimerniliex(2)>apply_after3|>seconds,do: IO.puts"hello"{:ok,{1407446427626194,#Reference<0.0.0.371>}}iex(3)>helloiex(1)>importBlockTimerniliex(2)>{:ok,counter}=Agent.start_linkfn->0end{:ok,#PID<0.70.0>}iex(3)>{:ok,tref} = apply_interval1|>secondsdo...(3)>Agent.update(counter,fn(count)->count+1end)...(3)>IO.putsAgent.get(counter,fn(count)->countend)...(3)>end{:ok,{:interval,#Reference<0.0.0.382>}}iex(4)> 12345:timer.canceltref{:ok,:cancel}iex(5)>