*`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.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.tagged(tag1, tag2, tag3 ...)` filters other cron methods (`cron.after`, `cron.every`, `cron.update`&`cron.cancel` but not `cron.reset`) so that they create clocks with specific tags/ act on clocks with specific tags.
*`cron.lua` does *not* implement any hardware or software clock; you will have to provide it with the access to the hardware timers, in the form of periodic calls to `cron.update`
*`cron` does not have any defined time units (seconds, milliseconds, etc). You define the units it uses by passing it a `dt` on `cron.update`. If `dt` is in seconds, then `cron` will work in seconds. If `dt` is in milliseconds, then `cron` will work in milliseconds.
Installation
============
Just copy the cron.lua file somewhere in your projects (maybe inside a /lib/ folder) and require it accordingly.
Remember to store the value returned by require somewhere! (I suggest a local variable named `cron`)
local cron = require 'cron'
Also, make sure to read the license file; the text of that license file must appear somewhere in your projects' files.
Specs
=====
This project uses "telescope":https://github.com/norman/telescope for its specs. If you want to run the specs, you will have to install telescope first. Then run: