I want to calculate the time elapsed since the execution of take_forks() but the value of "b" and "end"are always 0.Why this happens?
Code:clock_t start,end; start=clock();//clocks before taking the forks take_forks(i); end=clock();//clocks after taking forks double b=(double)(end-start)/(double)(CLOCKS_PER_SEC); tmesos=tmesos+(b/counter)/n; printf("waiting time is %f",b);




Reply With Quote