setTimeLimit package:base R Documentation _S_e_t _C_P_U _a_n_d/_o_r _E_l_a_p_s_e_d _T_i_m_e _L_i_m_i_t_s _D_e_s_c_r_i_p_t_i_o_n: Functions to set CPU and/or elapsed time limits for top-level computations or the current session. _U_s_a_g_e: setTimeLimit(cpu = Inf, elapsed = Inf, transient = FALSE) setSessionTimeLimit(cpu = Inf, elapsed = Inf) _A_r_g_u_m_e_n_t_s: cpu: double. Limit on total cpu time. elapsed: double. Limit on elapsed time. transient: logical. If 'TRUE', the limits apply only to the rest of the current computation. _D_e_t_a_i_l_s: '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 Foreign code identified by the code author. 'Total cpu time' includes that used by child processes where the latter is reported. It is possible (but very unusual) to build R without support for 'proc.time', in which case these functions have no effect.