title: Timing R code with Sys.time()
body: <p>I can run a piece of code for 5 or 10 seconds using the following code:</p>
  
  <pre><code>period &lt;- 10  ## minimum time (in seconds) that the loop should run for
  tm &lt;- Sys.time()  ## starting data &amp; time
  while(Sys.time() - tm &lt; period) print(Sys.time())
  </code></pre>
  
  <p>The code runs just fine for 5 or 10 seconds. But when I replace the period value by 60 for it to run for a minute, the code never stops. What is wrong?</p>