Rev 37671 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{proc.time}\alias{proc.time}\title{Running Time of R}\description{\code{proc.time} determines how much time (in seconds) the currentlyrunning \R process already consumed.}\usage{proc.time()}\value{A numeric vector of length 5, containing the user, system, and totalelapsed times for the currently running \R process, and the cumulativesum of user and system times of any child processes spawned by it.The resolution of the times will be system-specific;#ifdef unixand times are rounded to the nearest 1ms. On modern systems they willbe that accurate, but on older systems they might be accurate to1/100 or 1/60 sec.#endif#ifdef windowsand times are typically available to 10ms on NT-based versions of Windows.#endifIt is most useful for \dQuote{timing} the evaluation of \R expressions,which can be done conveniently with \code{\link{system.time}}.}\note{#ifdef unixIt is possible to compile \R without support for \code{proc.time},when the function will throw an error.#endif#ifdef windowsCPU times will be returned as \code{NA} on Windows 9x/ME systems, butare genuine times on NT4/2000/XP systems. Times of child processes arenot available and will always be given as \code{NA}.#endif}\references{Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)\emph{The New S Language}.Wadsworth \& Brooks/Cole.}\seealso{\code{\link{system.time}} for timing a valid \R expression,\code{\link{gc.time}} for how much of the time was spent in garbagecollection.}\examples{\dontrun{## a way to time an R expression: system.time is preferredptm <- proc.time()for (i in 1:50) mad(runif(500))proc.time() - ptm}}\keyword{utilities}