workout({
x <- 1:1000
evens <- x %% 2 == 0
y <- x[evens]
length(y)
length(which(evens))
sum(evens)
})
# The equivalent to the above, reading the code from a file
workout_expressions(as.list(parse(system.file("examples/exprs.R", package = "bench"))))
Run the code above in your browser using DataLab