system.time {base} R Documentation

## CPU Time Used

### Description

Return CPU (and other) times that expr used.

### Usage

system.time(expr, gcFirst = TRUE)


### Arguments

 expr Valid R expression to be timed. gcFirst Logical - should a garbage collection be performed immediately before the timing? Default is TRUE.

### Details

system.time calls the function proc.time, evaluates expr, and then calls proc.time once more, returning the difference between the two proc.time calls.

unix.time has been an alias of system.time, for compatibility with S, has been deprecated in 2016 and finally became defunct in 2022.

Timings of evaluations of the same expression can vary considerably depending on whether the evaluation triggers a garbage collection. When gcFirst is TRUE a garbage collection (gc) will be performed immediately before the evaluation of expr. This will usually produce more consistent timings.

### Value

A object of class "proc_time": see proc.time for details.

proc.time, time which is for time series.

setTimeLimit to limit the (CPU/elapsed) time R is allowed to use.

Sys.time to get the current date & time.

### Examples

require(stats)
## End(Not run)