% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/method-timing.R
\name{timing}
\alias{timing}
\alias{timing,INLAvaan-method}
\title{Timing Information for INLAvaan Models}
\usage{
timing(object, ...)

\S4method{timing}{INLAvaan}(object, what = "total", ...)
}
\arguments{
\item{object}{An object of class \link{INLAvaan}.}

\item{...}{Currently unused.}

\item{what}{Character vector of timing segment names to return, or
\code{"all"} to return every segment. Defaults to \code{"total"}.
Available segments (depending on model options): \code{"init"},
\code{"optim"}, \code{"vb"}, \code{"loglik"}, \code{"marginals"},
\code{"norta"}, \code{"sampling"}, \code{"covariances"},
\code{"definedpars"}, \code{"deltapars"}, \code{"test"}, \code{"total"}.}
}
\value{
A named numeric vector (class \code{c("timing.INLAvaan",
  "numeric")}) of elapsed times in seconds. Printing formats short
durations as seconds, longer ones as minutes or hours.
}
\description{
Extract wall-clock timings for individual computation stages of a fitted
\code{INLAvaan} model.
}
\examples{
\donttest{
HS.model <- "
  visual  =~ x1 + x2 + x3
  textual =~ x4 + x5 + x6
  speed   =~ x7 + x8 + x9
"
utils::data("HolzingerSwineford1939", package = "lavaan")
fit <- acfa(HS.model, HolzingerSwineford1939, std.lv = TRUE, nsamp = 100,
            test = "none", verbose = FALSE)

# Total elapsed time
timing(fit)

# All stages
timing(fit, what = "all")

# Specific stages
timing(fit, what = c("optim", "marginals"))
}

}
\seealso{
\code{\link[=diagnostics]{diagnostics()}}, \code{\link[=summary]{summary()}}
}
