
Last chance! 50% off unlimited learning
Sale ends in
tic
starts the timer and toc
updates the elapsed time since the timer was started.tic(gcFirst=FALSE)
toc(echo=TRUE)
TRUE
, perform garbage collection
prior to starting stopwatchTRUE
, print elapsed time to screentoc
invisibly returns the elapsed time as a named scalar (vector).system.time
.
Function toc
can be invoked multiple times in a row.tic()
for(i in 1:100) mad(runif(1000)) # kill time
toc()
Run the code above in your browser using DataLab