powered by
This function uses
forkTimeout(expr, timeout, unsupported = c("warning", "error", "message", "silent"), onTimeout = NULL)
expression to be evaluated.
number of seconds to wait for the expression to evaluate.
a character vector of length 1 specifying how to handle a platform that does not support
Value to be returned on time-out.
Result of evaluating expr if completed, onTimeout otherwise.
expr
onTimeout
# NOT RUN { forkTimeout({Sys.sleep(1); TRUE}, 2) # TRUE forkTimeout({Sys.sleep(1); TRUE}, 0.5) # NULL (except on Windows) # }
Run the code above in your browser using DataLab