You can use the Sys.sleep function from the base package to suspend execution for a given time interval.
According to R Documentation:
Using this function allows R to temporarily be given very low priority and hence not to interfere with more important foreground tasks. Typical use is to allow a process launched from R to set itself up and read its input files before R execution is resumed.
For example:
testit <- function(x)
{
p1 <- proc.time()
Sys.sleep(x)
proc.time() - p1 # The cpu usage should be negligible
}
testit(3.7)
testit(3.7)
user system elapsed
0.00 0.00 3.71
testit(5)
user system elapsed
0.01 0.00 5.05
To know more about this function see help(Sys.sleep).