How to benchmark few lines of code in nim?
<p>I read this down and up: <a href="http://nim-lang.org/docs/times.html" rel="noreferrer">http://nim-lang.org/docs/times.html</a></p>

<p>But still cannot figure the simple thing: how to get time in ms twice, once before my code, and again after my code runs, and then print the difference?</p>

<p>I tried their example:</p>

<pre><code>var t0 = cpuTime()
sleep(300)
echo "CPU time [s] ", cpuTime() - t0
</code></pre>

<p>But this prints something meaningless:</p>

<pre><code>CPU time [s] 4.200000000000005e-05
</code></pre>