Get the elapsed time for estimating the given model.

For lcModel: Get the estimation time of the model, determined by the time taken for the associated fit() function to finish.

estimationTime(object, unit = "secs", ...)

# S4 method for lcModel
estimationTime(object, unit = "secs", ...)

# S4 method for lcModels
estimationTime(object, unit = "secs", ...)

# S4 method for list
estimationTime(object, unit = "secs", ...)

Arguments

object

The model.

unit

The time unit in which the estimation time should be outputted. By default, estimation time is in seconds. For accepted units, see base::difftime.

...

Not used.

Value

A non-negative scalar numeric representing the estimation time in the specified unit..

Examples

data(latrendData)
method <- lcMethodLMKM(Y ~ Time, id = "Id", time = "Time")
model <- latrend(method, latrendData)

estimationTime(model)
#> [1] 0.094
estimationTime(model, unit = 'mins')
#> [1] 0.001566667
estimationTime(model, unit = 'days')
#> [1] 1.087963e-06