TransferWare / dbug

DBUG - debugging for C and Oracle PL/SQL
https://TransferWare.github.io/dbug/
GNU Lesser General Public License v3.0
0 stars 0 forks source link

The Unix clock function calculates the CPU time, not the wall clock time. #4

Closed gpaulissen closed 1 year ago

gpaulissen commented 1 year ago

Depending on the environment either clock(), ftime() or getrusage() were used for calculating a double time (in seconds and after the digit the fractional seconds). The clock() function does its job on Windows however not on Unix.

See also 8 Ways to Measure Execution Time in C/C++.

gpaulissen commented 1 year ago

Now first clock_gettime() and gettimeofday() are used before the others.