How to check the time of each code in R



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


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

and also profile your code

also read this-


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

your code

Hope this help!