← All built-ins / ui_timer()
ui_timer()
ui_timer(...$args): int
Parameters
| Name | Type | Description |
|---|---|---|
| $ms | int | interval in milliseconds |
| $callback | closure | called every interval |
Return value
Starts a repeating timer until ui_quit().
Example
echo "ui_timer(1000, fn() => ui_set($clock, date("H:i:s")));";ui_timer(1000, fn() => ui_set($clock, date("H:i:s")));This call needs a real environment (window, server, database or stdin) — the snippet above shows the typical usage shape.