Every time you run code and then sleep you will be drifting a little bit from running, say, every second. If this is an issue then don't use sleep . Further, sleep isn't very flexible when it comes to control. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.