Time formatting: how to write a While loop that operates for a whole minute?
问题 I have written the following function: iterations_per_minute = function() { Sys.setenv(TZ='GMT+5') ## This line is optional; it just sets my timezone final_instant = as.numeric(format(Sys.time(), "%H.%M")) + 0.01 counter = 0 while(as.numeric(format(Sys.time(), "%H.%M")) < final_instant) { counter = counter + 1 } return(counter) } You can infer from the code what the function does, but allow me to explain in lay words anyway: what number can you reach by counting as fast as possible during one