Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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.


styler

Non-Invasive Pretty Printing of R Code

v1.4.1
MIT + file LICENSE
Authors
Kirill Müller [aut], Lorenz Walthert [cre, aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.