do.call_timed: Measure computation time

View source: R/do.call_timed.R

do.call_timedR Documentation

Measure computation time

Description

This function measures the computation time of a call.

Usage

do.call_timed(what, args, units = "secs")

Arguments

what, args

Passed to do.call.

units

Passed to difftime.

Details

This function is a wrapper for do.call.

Value

A list of the two elements "result" (the results of the do.call call) and "time" (the computation time).

See Also

Other function helpers: function_arguments(), function_body(), function_defaults(), quiet(), timed(), try_silent(), variable_name()

Examples

## Not run: 
what <- function(s) {
  Sys.sleep(s)
  return(s)
}
args <- list(s = 1)
do.call_timed(what = what, args = args)

## End(Not run)

oeli documentation built on Oct. 16, 2024, 5:08 p.m.