Time-related functions for Lua inspired by JavaScript's setTimeout and setInterval.
cron.lua is a lightweight Lua library that provides time-related functions inspired by JavaScript's setTimeout and setInterval. It allows developers to schedule delayed or periodic callbacks in their Lua applications, solving the need for manual timer management in games, simulations, or scripts.
Lua developers building games, simulations, or applications requiring precise timing control without heavy dependencies.
Developers choose cron.lua for its simplicity, minimal overhead, and flexibility in handling time units, making it an ideal drop-in solution for timing needs in Lua projects.
Time-related functions for Lua, inspired in javascript's setTimeout and setInterval
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Functions like cron.after and cron.every provide straightforward scheduling, as demonstrated in the README examples for delayed and periodic callbacks.
The library works with any time unit based on the dt parameter, allowing use of seconds, milliseconds, or custom units, as noted in the gotchas section.
By requiring explicit calls to clock:update(dt), developers can integrate timing precisely with application loops, ideal for frame-based updates in games.
cron.lua is a single file with no external dependencies, making it easy to install and integrate without bloat, as highlighted in the installation notes.
The README explicitly states cron.lua does not implement any clock, forcing developers to manually handle time updates, which adds overhead and potential errors.
It lacks features like timer cancellation, priority scheduling, or error handling, making it unsuitable for complex timing needs beyond basic callbacks.
Since updates are manual, inaccuracies in providing dt can lead to timing drift, affecting precision in sensitive applications like real-time simulations.