sleep support for inside a while loop, only one sleep can be used at the end of the loop.