Learn R Programming

styler (version 1.5.1)

n_times_faster_with_cache: Times two function calls with temporarily enabled cache

Description

This can be helpful for benchmarking.

Usage

n_times_faster_with_cache(
  x1,
  x2 = x1,
  ...,
  fun = styler::style_text,
  n = 3,
  clear = "always"
)

Arguments

...

Arguments passed to fun.

fun

The function that should be timed.

n

The number of times the experiment should be repeated.

Value

A scalar indicating the relative difference of the second compared to the first run.