Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

time delay loops?

Name: Anonymous 2008-03-31 7:59

hey /prog/
sepples is my hobby and i'm currently reading through a book called "c++: the complete reference". on page 77 the author is talking about "loops with no bodies" and says:
"Time delay loops are often used in programs. The following code shows how to create one by using for:
for(t=0;t<SOME_VALUE;t++);"

i looked in the appendix and that seems to be the only mention of it in the book.
can someone please kindly tell me what the fuck it is useful for? it just seems to be a waste of processing power.
am i missing something?

Name: Anonymous 2008-04-02 0:07

volatile int t = SOME_VALUE;
while(t--);

ZOMG OPTIMIZED

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List