sleep

sleep

sleep EXPR

sleep

Causes the script to sleep for (integer) EXPR seconds, or forever if no argument is given. Returns the integer number of seconds actually slept.

May be interrupted if the process receives a signal such as SIGALRM .

eval {
    local $SIG{ALARM} = sub { die "Alarm!\n" };
    sleep;
};
die $@ unless $@ eq "Alarm!\n";

You probably cannot mix alarm and sleep calls, because sleep is often implemented using alarm-

On some older systems, it may sleep up to a full second less than what you