proc.time determines how much real and CPU time (in seconds) the currently running R process has already taken.
proc.time()
# 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
# }