0

Is there a way to find to see what is the time taken to perform certain operation in R. I know we can use system start time and end time. But is there another way to do this. Something like timetaken(fun(3,4))

for example

fun <- function(x,y){
c = x + y
return(c)
}

fun(3,4)
7
imran p
  • 332
  • 2
  • 12
  • `system.time(fun(3, 4))` is simplest, without using extra packages. – Gregor Thomas Apr 28 '20 at 13:18
  • Thanks.... May i know what is ````user system elapsed```` please – imran p Apr 28 '20 at 13:25
  • I noticed one thing, When I run this all time for the same operation. I get different time. Why? – imran p Apr 28 '20 at 13:28
  • Because time is variable. Your computer is complicated, and doing lots of things at any given time. You can use `microbenchmark::microbenchmark()` to run things multiple times and see statistics of the run time distribution. – Gregor Thomas Apr 28 '20 at 13:43

0 Answers0