perlfunc
gods
<P>
sleep - block for some number of seconds
<P>
<P>
sleep
<FONT SIZE=-1>EXPR</FONT>
<P>
sleep
<P>
Causes the script to sleep for
<FONT SIZE=-1>EXPR</FONT> seconds, or forever if no
<FONT SIZE=-1>EXPR.</FONT> May be interrupted if the process receives a signal such as
<CODE>SIGALRM</CODE>. Returns the number of seconds actually slept. You probably cannot mix [perlfunc:alarm|alarm()] and [perlfunc:sleep|sleep()] calls, because [perlfunc:sleep|sleep()] is often implemented using [perlfunc:alarm|alarm()].
<P>
On some older systems, it may sleep up to a full second less than what you
requested, depending on how it counts seconds. Most modern systems always
sleep the full amount. They may appear to sleep longer than that, however,
because your process might not be scheduled right away in a busy
multitasking system.
<P>
For delays of finer granularity than one second, you may use Perl's
[perlfunc:syscall|syscall()] interface to access
<CODE>setitimer(2)</CODE> if your
system supports it, or else see [perlfunc:select|select()] above.
<P>
See also the
<FONT SIZE=-1>POSIX</FONT> module's <CODE>sigpause()</CODE> function.