time_operation: Measure the time of an operation and record the duration

View source: R/utils.R

time_operationR Documentation

Measure the time of an operation and record the duration

Description

Measure the time of an operation and record the duration

Usage

time_operation(expr, label, verbose = TRUE)

Arguments

expr

Expression to measure

label

Label for the operation

verbose

If TRUE, print the time information (default: TRUE)

Value

The value of expr. The elapsed time is recorded and can be retrieved with get_timings().

Examples

x <- time_operation(sum(1:10), "sum")
get_timings()

varunayan documentation built on Oct. 30, 2026, 1:07 a.m.