Learn R Programming

matlab (version 0.7-7)

tictoc: MATLAB timer functions

Description

Provides stopwatch timer. Function tic starts the timer and toc updates the elapsed time since the timer was started.

Usage

tic(gcFirst = FALSE)
toc(echo = TRUE)

Arguments

gcFirst
logical. If TRUE, perform garbage collection prior to starting stopwatch
echo
logical. If TRUE, print elapsed time to screen

Details

Provides analog to base::system.time. Function toc can be invoked multiple times in a row.

Examples

Run this code
tic()
for(i in 1:100) mad(runif(1000))	# kill time
toc()

Run the code above in your browser using DataLab