n_times_faster_with_cache: Times two function calls with temporarily enabled cache

Description Usage Arguments Value

View source: R/testing.R

Description

This can be helpful for benchmarking.

Usage

1
2
3
4
5
6
7
8
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 documentation built on Sept. 23, 2021, 5:07 p.m.