proc.time
Running Time of Spotfire Enterprise Runtime for R
Description
Returns a length 5 vector of cumulative times for the current engine
session.
Usage
proc.time()
## S3 method for class 'proc_time':
print(x, ...)
## S3 method for class 'proc_time':
summary(object, ...)
Arguments
x |
An object of class "proc_time" to print
|
object |
An object of class "proc_time" to summarize
|
... |
Other arguments to print and summary are silently ignored.
|
Value
returns a five-long numeric vector of class proc_time
giving the user, system, and elapsed times
for the currently running process and the total user and system times
for any child processes that have started and finished.
(The child times are currently NA on Windows.)
The names attached to this vector are "user.self", "sys.self", "elapsed",
"user.child", and "sys.child".
All times have units of seconds.
Note
This function is likely to be most useful in recording checkpoints
for computations. You can time particular expressions by computing
the difference between such checkpoints. The last two columns
(elapsed times for child processes) are missing values, NA, in Windows.
The print and summary methods for class proc_time add the child times,
if not NA, to the session times to show the total user, system,
and elapsed times and make their names "user", "system", and "elapsed".
References
Becker, R. A., Chambers, J. M., and Wilks, A. R. 1988. The New S Language. Pacific Grove, CA: Wadsworth & Brooks/Cole Advanced Books and Software.
See Also
Examples
now <- proc.time() # checkpoint
random <- runif(1e7) # computation of interest
proc.time() - now # time taken for computation
# or, equivalently,
system.time(runif(1e7)) # time taken for computation