R: bench: High Precision Timing of R Expressions

bench-package {bench} | R Documentation

## bench: High Precision Timing of R Expressions

### Description

Tools to accurately benchmark and analyze execution times for R expressions.

### Author(s)

Maintainer: Jim Hester james.f.hester@gmail.com

### See Also

Useful links:

- https://github.com/r-lib/bench

- Report bugs at https://github.com/r-lib/bench/issues

### Examples

    dat <- data.frame(x = runif(10000, 1, 1000), y=runif(10000, 1, 1000))

    # `bench::mark()` implicitly calls summary() automatically
    results <- bench::mark(
      dat[dat$x > 500, ],
      dat[which(dat$x > 500), ],
      subset(dat, x > 500))

    # However you can also do so explicitly to filter gc differently.
    summary(results, filter_gc = FALSE)

    # Or output relative times
    summary(results, relative = TRUE)

[Package bench version 1.0.2 Index]