Measure Execution Time of Function in R (Example) | Time Difference of Application | Sys.time

preview_player
Показать описание
R Code of this video:

N1 <- 10^5 # First sample size
N2 <- 10^8 # Second sample size

x1 <- rnorm(N1) # Apply rnorm function to N1

time1 <- end1 - start1 # Time difference between start & end
time1 # Print time difference to console

x2 <- rnorm(N2) # Apply rnorm function to N2

time2 <- end2 - start2 # Time difference between start & end
time2 # Print time difference to console
Рекомендации по теме
welcome to shbcf.ru