If you read the man page I linked to, you would see that dividing the return value from clock() with CLOCKS_PER_SEC gives you the result in seconds. Hence, if you multiply (t1 - t0) by 1000 before...
Type: Posts; User: iceaway
If you read the man page I linked to, you would see that dividing the return value from clock() with CLOCKS_PER_SEC gives you the result in seconds. Hence, if you multiply (t1 - t0) by 1000 before...
Then you should probably use clock() instead of gettimeofday().
clock_t t0, t1, elapsed;
t0 = clock();
/* Call function */
t1 = clock();
elapsed = 1000 * (t1 - t0) / (CLOCKS_PER_SEC);...
Do you want the wall-clock time or the actual time that the processor is running your code?