Sleep function. May block for longer than requested, with the actual wait time determined by the capabilities of the underlying system.

msleep(msec)

Arguments

msec

integer number of milliseconds to block the caller.

Value

Invisible NULL.

Details

If 'msec' is non-integer, it will be coerced to integer. Non-numeric input will be ignored and return immediately.

Note that unlike Sys.sleep, this function is not user-interruptible by sending SIGINT e.g. with ctrl + c.

Examples

time <- mclock(); msleep(100); mclock() - time
#> [1] 102