For example, I want to know the time it took to finish and the computing power. The idea of knowing these things exactly is so that it can help me choose between different computing methods that have the same task.
Asked
Active
Viewed 151 times
-2
-
see `?system.time` and perhaps package `microbenchmark` for timing details: http://cran.r-project.org/web/packages/microbenchmark/index.html – Chase Sep 23 '14 at 15:51
-
1Add `Rprof` to that list if you're examining a function or a longer code chunk. `tracemem` for copying – Rich Scriven Sep 23 '14 at 15:52
-
and this post seems relevant re: memory usage: http://stackoverflow.com/questions/7856306/monitor-memory-usage-in-r – Chase Sep 23 '14 at 15:52
-
...and [this](http://stackoverflow.com/q/3650862/324364) and the performant code section of [Hadley's book](http://adv-r.had.co.nz/). – joran Sep 23 '14 at 15:53
1 Answers
1
Time to finish is easy:
get execution time in milliseconds in R
Get system time at the start and end of your code and calculate the different.
"Computing power" is harder. CPU? Memory? Disk I/O? What's the criterion for deciding?