Rev 10090 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{Sys.sleep}\alias{Sys.sleep}\title{Suspend Execution for a Time Interval}\description{Suspend execution of \R expressions for a given number of seconds}\usage{Sys.sleep(time)}\arguments{\item{time}{The time interval to suspend execution for, in seconds.}}\details{Using this function allows \R to be given very low priority and hencenot to interfere with more important foreground tasks. A typical useis to allow a process lauched from \R to set itself up and read itsinput files before \R execution is resumed.The intention is that this function suspends execution of \Rexpressions but wakes the process up often enough to respond to GUIevents, typically every 0.5 seconds.There is no guarantee that the process will sleep for the whole of thespecified interval, and it may well take slightly longer in real timeto resume execution. The resolution of the time interval issystem-dependent, but will normally be down to 0.02 secs or better.}\value{Invisible \code{NULL}.}\author{B. D. Ripley}\note{This function is not implemented on all systems.}\examples{testit <- function(x){p1 <- proc.time()Sys.sleep(x)proc.time() - p1 # The cpu usage should be negligible}testit(3.7)}\keyword{utilities}