Cómo ajustar el código R con Sys.time ()

Puedo ejecutar un fragmento de código durante 5 o 10 segundos con el siguiente código:

period <- 10  ## minimum time (in seconds) that the loop should run for
tm <- Sys.time()  ## starting data & time
while(Sys.time() - tm < period) print(Sys.time())

El código funciona bien durante 5 o 10 segundos. Pero cuando reemplazo el valor del período por 60 para que se ejecute por un minuto, el código nunca se detiene. ¿Qué está mal

Respuestas a la pregunta(1)

Su respuesta a la pregunta