How to time event in C++?
<p>I'd like to be able to get number of nanoseconds it takes to do something in my C++ program.</p>

<p>Object creation, time for a function to do it's thing etc.</p>

<p>In <code>Java</code>, we'd do something along the lines of:</p>

<pre><code>    long now = System.currentTimeMillis();
    // stuff
    long diff = (System.currentTimeMillis() - now);
</code></pre>

<p>How would you do the same in C++?</p>
