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

msleep(time)

Arguments

time

integer number of milliseconds to block the caller.

Value

Invisible NULL.

Details

Non-integer values for 'time' are coerced to integer, and the absolute value is taken (the sign is ignored). Non-numeric values are ignored, causing the function to 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] 101