Interaction between for loops with clock function?!
Posted
by learningtolive
on Stack Overflow
See other posts from Stack Overflow
or by learningtolive
Published on 2010-06-10T17:59:33Z
Indexed on
2010/06/10
18:02 UTC
Read the original article
Hit count: 192
Can someone explain me the exact interaction in context of delay between the two for loops with clock function. How does for1 interact with for2 on the cout statement(30 on 640000000)?
start=clock();
cout<<endl<<start<<endl;
for(delay=0; delay<30; delay++)
for(i=0; i<640000000; i++);
end=clock();
cout<<end<<endl;
cout<<"Num of ticks for non reg-loop: ";
cout<<end-start<<'\n';
© Stack Overflow or respective owner