Unix and Linux Discussions Tagged with sleep |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
3,416 |
UNIX for Beginners Questions & Answers |
|
|
|
9 |
3,038 |
Shell Programming and Scripting |
|
|
|
5 |
1,125 |
Shell Programming and Scripting |
|
|
|
0 |
2,358 |
Shell Programming and Scripting |
|
|
|
15 |
3,987 |
Shell Programming and Scripting |
|
|
|
19 |
9,437 |
AIX |
|
|
|
2 |
9,356 |
Shell Programming and Scripting |
|
|
|
2 |
12,131 |
Shell Programming and Scripting |
|
|
|
9 |
28,369 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
15,280 |
UNIX for Dummies Questions & Answers |
|
|
|
0 |
1,721 |
OS X Support RSS |
|
|
|
7 |
13,064 |
Shell Programming and Scripting |
|
|
|
0 |
3,352 |
Debian |
|
|
|
0 |
707 |
Software Releases - RSS News |
|
|
|
0 |
719 |
Software Releases - RSS News |
|
|
|
0 |
709 |
Software Releases - RSS News |
|
|
|
0 |
801 |
Software Releases - RSS News |
|
|
|
0 |
731 |
Software Releases - RSS News |
|
|
|
0 |
666 |
Software Releases - RSS News |
|
|
|
0 |
752 |
Software Releases - RSS News |
|
|
|
0 |
722 |
Software Releases - RSS News |
|
|
|
5 |
49,254 |
Shell Programming and Scripting |
|
|
|
3 |
5,369 |
Programming |
|
|
|
10 |
78,907 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
5,522 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
4,045 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
14,729 |
Programming |
|
|
|
5 |
34,325 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
17,295 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
2,360 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
4,922 |
UNIX for Dummies Questions & Answers |
|
|
|
10 |
6,217 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,649 |
UNIX for Dummies Questions & Answers |
|
|
|
5 |
7,610 |
UNIX for Dummies Questions & Answers |
SLEEP(3) 1 SLEEP(3)
sleep - Delay execution
SYNOPSIS
int sleep (int $seconds)
DESCRIPTION
Delays the program execution for the given number of $seconds.
PARAMETERS
o $seconds
- Halt time in seconds.
RETURN VALUES
Returns zero on success, or FALSE on error.
If the call was interrupted by a signal, sleep(3) returns a non-zero value. On Windows, this value will always be 192 (the value of the
WAIT_IO_COMPLETION constant within the Windows API). On other platforms, the return value will be the number of seconds left to sleep.
ERRORS
/EXCEPTIONS
If the specified number of $seconds is negative, this function will generate a E_WARNING.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.4 | |
| | |
| | Before PHP 5.3.4, on Windows, sleep(3) always |
| | returns NULL when sleep has occurred, regardless |
| | of whether the sleep was interrupted or not. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
sleep(3) example
<?php
// current time
echo date('h:i:s') . "
";
// sleep for 10 seconds
sleep(10);
// wake up !
echo date('h:i:s') . "
";
?>
This example will output (after 10 seconds)
05:31:23
05:31:33
SEE ALSO
usleep(3), time_nanosleep(3), time_sleep_until(3), set_time_limit(3).
PHP Documentation Group SLEEP(3)