I’m looking for a way to store running times in a variable in R. In MATLAB one can do something along the lines:
tic;
…
x=toc;
and then the running time is stored in the variable x. I have tried doing the same thing with the tic() toc() function in R coming from the MATLAB-package without success. Furthermore I can’t see how this can be done using the system.time() function of R neither. Any help here is much appreciated.
Use the built-in
system.timefunction:or, alternatively the
benchmarkfunction fromrbenchmarkpackage: