Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

pcntl_alarm

Description

The pcntl_alarm of PCNTL for PHP sets an alarm clock for the delivery of a signal.

Syntax

pcntl_alarm(
    int $seconds
): int

Parameters

seconds

The number of seconds to wait. If seconds is zero, no new alarm is created.

Return

Returns the time in seconds that any previously scheduled alarm had remaining before it was to be delivered, or 0 if there was no previously scheduled alarm.

Examples

1 · seconds

<?

$seconds = 1;

$return = pcntl_alarm($seconds);

echo $return;

?>
0

2 · previous

<?

$seconds = 10;

pcntl_alarm($seconds);

$seconds = 1;

$return = pcntl_alarm($seconds);

echo $return;

?>
10
HomeMenu