I'm trying to make an automatic launch of the R script. I need to start the creaking every new five-minute done like this
while (TRUE) { Sys.sleep(300) print(Sys.time()) ------------- Основной код ------------- } but due to the fact that the main code runs for quite a long time, it turns out an unacceptably strong time offset
[1] "2018-07-23 09:37:02 CEST" [1] "2018-07-23 09:42:37 CEST" [1] "2018-07-23 09:48:48 CEST" [1] "2018-07-23 09:55:05 CEST" I think to do this: in the while loop, constantly check the time of Sys.time () and when the beginning of a new five-minute session begins, 9:45:01, then 9:50:01, and so on. run the script
But what should the code look like by the definition of the five minutes? who knows? Or are there alternative ways? Thanks in advance for your reply
while ( (min % 5) != 0 ) sleep(1);- nick_n_a