How to check the time of each code in R

r

#1

I am currently trying to optimize my code for this I want to know how much time spent by my code for execution and how much it waits for the user to give input but how in R I can perform this


#2

you can use system.time() to measure code execution, or use the microbenchmark package

https://cran.r-project.org/web/packages/microbenchmark/index.html

and also profile your code

also read this- http://adv-r.had.co.nz/Profiling.html


#3

@sid100158- you can use the sys.time function to know the time of your code in bracket you put your code
sys.time(

your code
)

Hope this help!
Regards!
hinduja1234