next up previous
Next: while Loop Up: for Loop Previous: The Infinite Loop

Time Delay Loops

Time delay loops are often used in programs. These are loops that have no other function than to kill time. Delay loops can be created by specifying an empty target statement. For example:

for(x=0;x<1000;x++);

This loop increments x one thousand times but does nothing else. The semicolon that terminates the line is necessary because the for expects a statement.



Yousef Haik
2/23/1998