I have defined sleep() in my program. I am using it in a loop. But I observed that sleep() is adding up the total amount of delay (no of times loop executes) and only sleeps for this total amount of time in the beginning of execution. After that loop executes normally completely ignoring sleep() function. Same happened when I used window's Sleep(). Can any one pls help? I want sleep() to be called every time it appears in the loop and not just once in the beginning for total added delay. Thanks in advance.