I saw this question on running some code for 10 seconds.
period <- 10 ## minimum time (in seconds) that the loop should run for
tm <- Sys.time() ## starting data & time
while (difftime(Sys.time(), tm, units = "secs")[[1]] < period)
Instead I would like to NOT run anything for an hour, because of a download limit per hour.
period <- 60
tm <- Sys.time() ## starting data & time
while (difftime(Sys.time(), tm, units = "minutes")[[1]] < period)
I have a feeling that I am not approaching this problem from the right angle, could someone help me figure out how to do this?