bench (version 1.0.4)

workout: Workout a group of expressions individually

Description

Given an block of expressions in {} workout() individually times each expression in the group.

Usage

workout(expr, description = NULL)

Arguments

expr

one or more expressions to workout, use {} to pass multiple expressions.

description

A name to label each expression, if not supplied the deparsed expression will be used.

Examples

Run this code
# NOT RUN {
workout({
  x <- 1:1000
  evens <- x %% 2 == 0
  y <- x[evens]
  length(y)
  length(which(evens))
  sum(evens)
})
# }

Run the code above in your browser using DataLab