Module: cwc.timer
Low-level API to create a timer.
started |
boolean |
Whether the timer is currently running or not.
|
|
timeout |
boolean |
The timer timeout value in seconds.
|
|
-
🔗
cwc.timer.new (timeout, callback, options)
-
Create a new timer.
Parameters:
timeout |
|
number |
|
Not applicable |
callback |
|
function |
|
Not applicable |
options |
Optional |
table |
Additional settings |
Undefined |
autostart |
Optional |
boolean |
Immediately start the timer
countdown |
true |
call_now |
Optional |
boolean |
Immediately call the callback
function |
false |
single_shot |
Optional |
boolean |
Run only once then stop |
false |
one_shot |
Optional |
boolean |
Run only once then destroy |
false |
-
🔗
cwc.timer.delayed_call (callback)
-
Call the given function at the end of wayland event loop.
Parameters:
-
🔗
started
boolean
-
Whether the timer is currently running or not.
Constraints:
Default value
|
: false |
Valid values
|
: true or false . |
-
🔗
timeout
boolean
-
The timer timeout value in seconds.
Constraints:
Default value
|
: false |
Valid values
|
: true or false . |
-
🔗
:start ()
-
Start the timer.
-
🔗
:stop ()
-
Stop the timer.
-
🔗
:again ()
-
Restart the timer.
Equivalent to stopping the timer and then starting it again.
-
🔗
:destroy ()
-
Destroy the timer, invalidate the object and freeing it from memory.