setTimeLimit | R Documentation |
Functions to set CPU and/or elapsed time limits for top-level computations or the current session.
setTimeLimit(cpu = Inf, elapsed = Inf, transient = FALSE) setSessionTimeLimit(cpu = Inf, elapsed = Inf)
cpu, elapsed |
double (of length one). Set a limit on the total or elapsed cpu time in seconds, respectively. |
transient |
logical. If |
setTimeLimit
sets limits which apply to each top-level
computation, that is a command line (including any continuation lines)
entered at the console or from a file. If it is called from within a
computation the limits apply to the rest of the computation and
(unless transient = TRUE
) to subsequent top-level computations.
setSessionTimeLimit
sets limits for the rest of the
session. Once a session limit is reached it is reset to Inf
.
Setting any limit has a small overhead – well under 1% on the systems measured.
Time limits are checked whenever a user interrupt could occur.
This will happen frequently in R code and during Sys.sleep
,
but only at points in compiled C and Fortran code identified by the
code author.
‘Total cpu time’ includes that used by child processes where the latter is reported.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.