← All built-ins / ui_timer()

ui_timer()

ui_timer(...$args): int

Parameters

NameTypeDescription
$msintinterval in milliseconds
$callbackclosurecalled 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.

See also

ui_on()ui_run_main()