I have the sample code below:
f <- function(x) { v = 0 start = Sys.time() for (i in 1:x) { v = v + 1 } end = Sys.time() print(end-start)