mjolnir._asm.timer

Home: https://github.com/asmagill/mjolnir_asm.watcher

Execute functions with various timing rules.

This module is based primarily on code from the previous incarnation of Mjolnir by Steven Degutis.

days

mjolnir._asm.timer.days(n) -> sec

doafter

mjolnir._asm.timer.doafter(sec, fn)

Runs the function after sec seconds.

hours

mjolnir._asm.timer.hours(n) -> sec

minutes

mjolnir._asm.timer.minutes(n) -> sec

new

mjolnir._asm.timer.new(interval, fn) -> timer

Creates a new timer that can be started; interval is specified in seconds as a decimal number.

seconds

mjolnir._asm.timer.seconds(n) -> sec

weeks

mjolnir._asm.timer.weeks(n) -> sec

start

mjolnir._asm.timer:start() -> self

Begins to execute mjolnir._asm.timer.fn every N seconds, as defined when the timer was created; calling this does not cause an initial firing of the timer immediately.

stop

mjolnir._asm.timer:stop() -> self

Stops the timer's fn from getting called until started again.