## The function is currently defined as
function (expr, seconds, my.pid)
{
killer.pid <- system(intern = TRUE, paste("(sleep", seconds,
"; kill -9", my.pid, ")>/dev/null&
echo $!", sep = ""))
on.exit(system(paste("kill", killer.pid, "> /dev/null 2>&1",
sep = "")))
withCallingHandlers(expr, interrupt = function(...) {
stop("Timedout", call. = FALSE)
})
}
Run the code above in your browser using DataCamp Workspace