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
Links
PCNTL
- pcntl_async_signals
- pcntl_errno
- pcntl_exec
- pcntl_fork
- pcntl_get_last_error
- pcntl_getpriority
- pcntl_rfork
- pcntl_setpriority
- pcntl_signal
- pcntl_signal_dispatch
- pcntl_signal_get_handler
- pcntl_sigprocmask
- pcntl_sigtimedwait
- pcntl_sigwaitinfo
- pcntl_strerror
- pcntl_unshare
- pcntl_wait
- pcntl_waitpid
- pcntl_wexitstatus
- pcntl_wifexited
- pcntl_wifsignaled
- pcntl_wifstopped
- pcntl_wstopsig
- pcntl_wtermsig