Update the readme

This commit is contained in:
Tanner Rogalsky 2013-06-11 12:42:13 -04:00
parent 0f4bc8fd53
commit 2dbfcc7350

View File

@ -10,6 +10,7 @@ API
* `cron.after(time, callback)` will execute callback after the given amount of time units. Returns an identifier (`id`) * `cron.after(time, callback)` will execute callback after the given amount of time units. Returns an identifier (`id`)
* `cron.every(time, callback)` will repeat the same action periodically. Returns an identifier (`id`) * `cron.every(time, callback)` will repeat the same action periodically. Returns an identifier (`id`)
* `cron.doFor(time, callback)` will execute a callback every time `cron.update` is called until the timer expires. Returns an identifier (`id`)
* `cron.cancel(id)` will stop a timed action from happening, and will interrupt the periodical execution of a periodic action. * `cron.cancel(id)` will stop a timed action from happening, and will interrupt the periodical execution of a periodic action.
* `cron.reset()` removes all timed and periodic actions, and resets the time passed back to 0. * `cron.reset()` removes all timed and periodic actions, and resets the time passed back to 0.
* `cron.update(dt)` is needed to be executed on the main program loop. `dt` is the amount of time that has passed since the last iteration. When `cron.update` is executed, cron will check the list of pending actions and execute them if needed. * `cron.update(dt)` is needed to be executed on the main program loop. `dt` is the amount of time that has passed since the last iteration. When `cron.update` is executed, cron will check the list of pending actions and execute them if needed.