Hi
when i use clock() function i only get multiples of 10000, is that normal? I need to find number of clocks taken by a program but i need exact number.
I am using opensuse linux
Any idea??
Hi
when i use clock() function i only get multiples of 10000, is that normal? I need to find number of clocks taken by a program but i need exact number.
I am using opensuse linux
Any idea??
Try gettimeofday() or clock_gettime() instead.
per the Linux man page on clock(): C89, C99, POSIX.1-2001. POSIX requires that CLOCKS_PER_SEC equals 1000000 independent of the actual resolution.
this vlaue it is not the CPU clock rate. it is based on the cpu clock interrupt tick rate. so if you get multiples of 10000, and CLOCKS_PER_SEC == 1000000, the resolution is 10000/1000000 = 10 milliseconds