timeout and interval API
If you ever want to run a piece of code on a timed interval, or want to wait a few seconds, you don’t have to rely on timing tricks, as Hilbish has a timer API to set intervals and timeouts.
These are the simple functions
doc hilbish, or
Module hilbish on the Website).
An example of usage:
1local t = hilbish.timers.create(hilbish.timers.TIMEOUT, 5000, function()
2 print 'hello!'
6print(t.running) // true
|create(type, time, callback) -> @Timer
|Creates a timer that runs based on the specified
|get(id) -> @Timer
|Retrieves a timer via its ID.
|Constant for an interval timer type
|Constant for a timeout timer type
Creates a timer that runs based on the specified
What kind of timer to create, can either be
The amount of time the function should run in milliseconds.
The function to run for the timer.
Retrieves a timer via its ID.
The Job type describes a Hilbish timer.
|What type of timer it is
|If the timer is running
|The duration in milliseconds that the timer will run
Starts a timer.
Stops a timer.
Want to help improve this page? Create an issue.