title: Now() Accuracy in VBScript
body: <p>Now() in VBScript appears to return time in 10,000,000th of a second precision when called as CDbl(Now()). In attempting to use this to write a more accurate implementation of now which returns <a href="http://msdn.microsoft.com/en-us/library/aa387237%28VS.85%29.aspx" rel="nofollow noreferrer">CIM_DATETIME format</a> I found that in VBScript, despite being particularly precise, is not very accurate with the time only updating once per second. This can be demonstrated by watching the output from what follows:</p>
  
  <pre><code>i = 0
  While i &lt; 50
      gnow = Cdbl(now) 
      result = (gnow - Int(gnow))
      WScript.Echo CDate(gnow)
      WScript.Echo "Iteration " &amp; i &amp; ": " &amp; result
      WScript.Sleep(100)
      i = i + 1
  Wend
  </code></pre>
  
  <p>The question I'm now trying to answer is, given a VBScript that runs for less than a second which calls Now(), what time will be returned by Now()? Is it the time that the script interpreter started, the time when Now() was called, or something else?</p>