php8.5
Home/ Manual/ event / event/ Event::timer

Event::timer

PHP function Edit on GitHub ✎

(PECL event >= 1.2.6-beta)

Constructs timer event object

Description

Event::timer(EventBase $base, callable $cb, [mixed $arg]): Event

Constructs timer event object. This is a straightforward method to create a timer event. Note, the generic Event::__construct method can contruct signal event objects too.

Parameters

base

The associated event base object.

cb

The signal event callback. See Event callbacks.

arg

Custom data. If specified, it will be passed to the callback when event triggers.

Return Values

Returns Event object on success. Otherwise false.

Source: reference/event/event/timer.xml · from the official PHP manual (php/doc-en)