https://github.com/cran/pracma
Raw File
Tip revision: c79a04b5074656b36e591191eb8137b70a349932 authored by Hans W. Borchers on 30 June 2014, 00:00:00 UTC
version 1.7.0
Tip revision: c79a04b
tictoc.Rd
\name{tic,toc}
\alias{tic}
\alias{toc}
\title{MATLAB timer functions}
\description{
  Provides stopwatch timer. Function \code{tic} starts the timer and \code{toc}
  updates the elapsed time since the timer was started. 
}
\usage{
tic(gcFirst=FALSE)
toc(echo=TRUE)
}
\arguments{
  \item{gcFirst}{logical scalar. If \code{TRUE}, perform garbage collection
    prior to starting stopwatch}
  \item{echo}{logical scalar. If \code{TRUE}, print elapsed time to screen}
}
\details{
  Provides analog to \code{\link[base]{system.time}}.
  Function \code{toc} can be invoked multiple times in a row.
}
\value{
  \code{toc} invisibly returns the elapsed time as a named scalar (vector).
}
\examples{
tic()
for(i in 1:100) mad(runif(1000))	# kill time
toc()
}
\author{
  P. Roebuck \email{proebuck@mdanderson.org}
}
\keyword{utilities}

back to top