Rev 85254 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/setTimeLimit.Rd% Part of the R package, https://www.R-project.org% Copyright 1995-2016 R Core Team% Distributed under GPL 2 or later\name{setTimeLimit}\alias{setTimeLimit}\alias{setSessionTimeLimit}\title{Set CPU and/or Elapsed Time Limits}\description{Functions to set CPU and/or elapsed time limits for top-levelcomputations or the current session.}\usage{setTimeLimit(cpu = Inf, elapsed = Inf, transient = FALSE)setSessionTimeLimit(cpu = Inf, elapsed = Inf)}\arguments{\item{cpu, elapsed}{double (of length one). Set a limit onthe total or elapsed CPU time in seconds, respectively.}\item{transient}{logical. If \code{TRUE}, the limits apply only tothe rest of the current computation.}}\details{\code{setTimeLimit} sets limits which apply to each top-levelcomputation, that is a command line (including any continuation lines)entered at the console or from a file. If it is called from within acomputation the limits apply to the rest of the computation and(unless \code{transient = TRUE}) to subsequent top-level computations.\code{setSessionTimeLimit} sets limits for the rest of thesession. Once a session limit is reached it is reset to \code{Inf}.Setting any limit has a small overhead -- well under 1\% on thesystems measured.Time limits are checked whenever a user interrupt could occur.This will happen frequently in \R code and during \code{\link{Sys.sleep}},but only at points in compiled C and Fortran code identified by thecode author.#ifdef unix\sQuote{Total CPU time} includes that used by child processes wherethe latter is reported.#endif}\keyword{ utilities }