P
Pushkar Pradhan
I've decided to use clock() to time my routines, my code is like this:
clk1 = clock();
while (n != 1000000) {
mm_2r2c_2r2c_bc(&a, &b, &c);
n++;
}
clk2 = clock();
t2 = time(NULL);
printf("%g\n", clk2/CLOCKS_PER_SEC - clk1/CLOCKS_PER_SEC);
Result:
3.38969e-319
When I printed out CLOCKS_PER_SEC it is 999424.
What is the correct way to use clock() to time a routine?
clk1 = clock();
while (n != 1000000) {
mm_2r2c_2r2c_bc(&a, &b, &c);
n++;
}
clk2 = clock();
t2 = time(NULL);
printf("%g\n", clk2/CLOCKS_PER_SEC - clk1/CLOCKS_PER_SEC);
Result:
3.38969e-319
When I printed out CLOCKS_PER_SEC it is 999424.
What is the correct way to use clock() to time a routine?