 <p>Here's a hint - use:</p> <pre><code>var t = Date.now(); </code></pre> <p>to get the current time (measured in milliseconds since 00:00:00 UTC on 01/01/1970) with millisecond <em>resolution</em>.</p> <p>Note that the result will still be limited in <em>accuracy</em> by the system hardware.</p> <p>On older browsers without <code>Date.now()</code>, use:</p> <pre><code>var t = new Date().valueOf(); </code></pre> <p>or the terser </p> <pre><code>var t = +new Date(); </code></pre> <p>The latter uses numeric coercion (the <code>+</code> prefix) to generate an automatic call to <code>.valueOf()</code>.</p>