title: How does erlang:now() work?
body: <pre><code>-module(test_now).
  
  -compile(export_all).
  
  start() -&gt;  
      {_, A, _} = now(),
      loop(0, A).
  
  loop(A) -&gt;  
      {_, B, _} = now(),  
      if   
          B == A + 1 -&gt; loop(0, B);  
          true -&gt; loop(A)  
      end.  
  
  loop(T, B) -&gt;
      {_, C, _} = now(),
      if 
          C == B + 1 -&gt; io:write(T);
          true -&gt; loop(T+1, B)
      end.
  </code></pre>
  
  <p>Logically this code should run <code>1+</code> second. But the result returns rapidly, far less than one second. And if I invoke <code>test_now:start()</code> in the Eshell <strong>frequently</strong> (up-arrow, enter,up-arrow, enter...),  the results are always <code>999999ok</code>.</p>