The R Project SVN R

Rev

Rev 68948 | Rev 79230 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 68948 Rev 71621
Line 1... Line 1...
1
% File src/library/base/man/system.time.Rd
1
% File src/library/base/man/system.time.Rd
2
% Part of the R package, https://www.R-project.org
2
% Part of the R package, https://www.R-project.org
3
% Copyright 1995-2011 R Core Team
3
% Copyright 1995-2016 R Core Team
4
% Distributed under GPL 2 or later
4
% Distributed under GPL 2 or later
5
 
5
 
6
\name{system.time}
6
\name{system.time}
7
\title{CPU Time Used}
7
\title{CPU Time Used}
8
\usage{
8
\usage{
9
system.time(expr, gcFirst = TRUE)
9
system.time(expr, gcFirst = TRUE)
10
unix.time(expr, gcFirst = TRUE)
10
%Deprecated unix.time(expr, gcFirst = TRUE)
11
}
11
}
12
\alias{system.time}
12
\alias{system.time}
13
\alias{unix.time}
13
\alias{unix.time}
14
\arguments{
14
\arguments{
15
  \item{expr}{Valid \R expression to be timed.}
15
  \item{expr}{Valid \R expression to be timed.}
Line 21... Line 21...
21
\details{
21
\details{
22
  \code{system.time} calls the function \code{\link{proc.time}},
22
  \code{system.time} calls the function \code{\link{proc.time}},
23
  evaluates \code{expr}, and then calls \code{proc.time} once more,
23
  evaluates \code{expr}, and then calls \code{proc.time} once more,
24
  returning the difference between the two \code{proc.time} calls.
24
  returning the difference between the two \code{proc.time} calls.
25
 
25
 
26
  \code{unix.time} is an alias of \code{system.time}, for
26
  \code{unix.time} has been an alias of \code{system.time}, for
27
  compatibility with S.
27
  compatibility with S, and has finally been deprecated in 2016.
28
 
28
 
29
  Timings of evaluations of the same expression can vary considerably
29
  Timings of evaluations of the same expression can vary considerably
30
  depending on whether the evaluation triggers a garbage collection.  When
30
  depending on whether the evaluation triggers a garbage collection.  When
31
  \code{gcFirst} is \code{TRUE} a garbage collection (\code{\link{gc}})
31
  \code{gcFirst} is \code{TRUE} a garbage collection (\code{\link{gc}})
32
  will be performed immediately before the evaluation of \code{expr}.
32
  will be performed immediately before the evaluation of \code{expr}.
Line 36... Line 36...
36
  A object of class \code{"proc_time"}: see
36
  A object of class \code{"proc_time"}: see
37
  \code{\link{proc.time}} for details.
37
  \code{\link{proc.time}} for details.
38
}
38
}
39
\seealso{
39
\seealso{
40
  \code{\link{proc.time}}, \code{\link{time}} which is for time series.
40
  \code{\link{proc.time}}, \code{\link{time}} which is for time series.
41
  
41
 
42
  \code{\link{Sys.time}} to get the current date & time.
42
  \code{\link{Sys.time}} to get the current date & time.
43
}
43
}
44
\examples{
44
\examples{
45
require(stats)
45
require(stats)
46
\donttest{system.time(for(i in 1:100) mad(runif(1000)))}
46
\donttest{system.time(for(i in 1:100) mad(runif(1000)))}