Skip to content

Instantly share code, notes, and snippets.

@darioappsilon
Created May 23, 2022 06:39
Show Gist options
  • Save darioappsilon/4eda971250646290de379fc01a8081a9 to your computer and use it in GitHub Desktop.
Save darioappsilon/4eda971250646290de379fc01a8081a9 to your computer and use it in GitHub Desktop.
time <- function(...) {
time_measurement <- system.time(eval(...))
time_measurement[["user.self"]]
}
benchmark <- function(..., n = 100) {
times <- replicate(n, ...)
c(min = min(times), max = max(times), mean = mean(times))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment