For simple, home-made benchmarking I'd like to add a timer to my R script so that I know for how long it has been running. It's a script that's unleashed on loads of data so it can take for over an hour to complete. Therefore I'm looking for a method that tells me the exact time the script has been running.
The idea that I got was:
old = getCurrentTime()
# Do the rest of my script
(new = getCurrentTime() - old)
I don't know if this makes sense, but it seems the best way to do this, without having a counter running in the background, is by comparing the start time of the script and the time and the end and print the difference. However, I'm not sure how to get the time in R, get the difference, and format it in hh:mm:ss
.