How to measure function running time in Qt?
<p>I am calling <a href="https://en.wikipedia.org/wiki/Argon2" rel="noreferrer">argon2</a> - memory intensive hashing function in Qt and measuring its running time:</p>

<pre><code>...
QTime start = QTime::currentTime();
// call hashing function
QTime finish = QTime::currentTime();
time = start.msecsTo(finish) / 1000.0;
...
</code></pre>

<p>In argon2 library's test case, time is measured in another way:</p>

<pre><code>...
clock_t start = clock();
// call hashing function
clock_t finish = clock();
time = ((double)finish - start) / CLOCKS_PER_SEC;
...
</code></pre>

<p>I am calling the function exactly as they call in their test case. But I am getting a twice bigger number (twice slower). Why? How to measure function running time in Qt? What clock() actually measures?</p>

<p><strong>env</strong>:virtualBox, Ubuntu14.04 64bit, Qt5.2.1, Qt Creator 3.0.1.</p>