ID EN
System & OS

proc.time

R Base 3.6.2

proc.time determines how much real and CPU time (in seconds) the currently running R process has already taken.

Syntax

R
proc.time()

Return Value

An object of class "proc_time" which is a numeric vector of length 5, containing the user, system, and total elapsed times for the currently running R process, and the cumulative sum of user and system times of any child processes spawned by it on which it has waited. (The print method uses the summary method to combine the child times with those of the main process.) The definition of ‘user’ and ‘system’ times is from your OS. Typically it is something like The ‘user time’ is the CPU time charg

Details

proc.time returns five elements for backwards compatibility, but its print method prints a named vector of length 3. The first two entries are the total user and system CPU times of the current R process and any child processes on which it has waited, and the third entry is the ‘real’ elapsed time since the process was started.

Examples

Example
R
# NOT RUN {
## a way to time an R expression: system.time is preferred
ptm <- proc.time()
for (i in 1:50) mad(stats::runif(500))
proc.time() - ptm
# }

See Also

system.time for timing an R expression gc.time for how much of the time was spent in garbage collection.