\HeaderA{Sys.sleep}{Suspend Execution for a Time Interval}{Sys.sleep}
\keyword{utilities}{Sys.sleep}
\begin{Description}\relax
Suspend execution of \R{} expressions for a given number of seconds
\end{Description}
\begin{Usage}
\begin{verbatim}
Sys.sleep(time)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{time}] The time interval to suspend execution for, in seconds.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Using this function allows \R{} to be given very low priority and hence
not to interfere with more important foreground tasks. A typical use
is to allow a process launched from \R{} to set itself up and read its
input files before \R{} execution is resumed.

The intention is that this function suspends execution of \R{}
expressions but wakes the process up often enough to respond to GUI
events, typically every 0.5 seconds.

There is no guarantee that the process will sleep for the whole of the
specified interval, and it may well take slightly longer in real time
to resume execution.  The resolution of the time interval is
system-dependent, but will normally be down to 0.02 secs or better.
(On modern Unix-alikes it will be better than 1ms.)
\end{Details}
\begin{Value}
Invisible \code{NULL}.
\end{Value}
\begin{Note}\relax
This function may not be implemented on all systems.
\end{Note}
\begin{Examples}
\begin{ExampleCode}
testit <- function(x)
{
    p1 <- proc.time()
    Sys.sleep(x)
    proc.time() - p1 # The cpu usage should be negligible
}
testit(3.7)
\end{ExampleCode}
\end{Examples}

