[erlang-questions] repeat function every hour

Max Lapshin <>
Fri Apr 30 07:07:07 CEST 2010


I had to make my own ticker: it runs erlang:now() and calculates how
many milliseconds left till the end of current minute:

minute_end({Mega,Sec,Micro}) ->
  Number = (Mega * 1000000 + Sec) div 60,
  Seconds = (Mega * 1000000 + Sec) rem 60,
  Milli = Seconds * 1000 + (Micro div 1000),
  {?INTERVAL - Milli, Number}.


More information about the erlang-questions mailing list