Skip to content

Instantly share code, notes, and snippets.

@jankuc
Created August 31, 2018 06:59
Show Gist options
  • Save jankuc/c4f48b40e10408f995a4a82cfc9b7ef8 to your computer and use it in GitHub Desktop.
Save jankuc/c4f48b40e10408f995a4a82cfc9b7ef8 to your computer and use it in GitHub Desktop.
How to meassure execution time in R
library(lubridate)
t1 <- Sys.time()
# DO STUFF
t2 <- Sys.time()
time_diff <- difftime(t2, t1, units = 'secs')
duration_str <- hms::as.hms(round(time_diff, 3))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment