- #1
Vagrant
- 195
- 1
Homework Statement
I want to compare the execution times for DDA and Bresenham's Line algorithm using a C program. I used the clock_t command; I'm getting the execution time for Bresenham’s algorithm as 0.164835 but 0 for DDA.
3. The Attempt at a Solution
clock_t start,end;
start=clock();
Bresenham's line algorithm code
end=clock();
printf("time=%f\n",(end-start)/CLK_TCK);
start=clock();
DDA line algorithm code
end=clock();
printf("time=%f\n",(end-start)/CLK_TCK);
Also I'm getting t=0.164835 for both codes separately. Whereas DDA line algorithm should take more time. What is it that I’m doing wrong?