I suggest you simply don't...
quote:
Originally posted by CookieRevised
Each time I needed a sleep() in programs I made, there were always better ways to do this.
What I mean is, you can almost always make a program without the use of a sleep() or the likes. The use of sleep() is almost always not needed at all and often is the result of a bad made routine... at least that's my experience of it.
(there are some uses for it of course, but they are rare)
In the shown routine you could easly make that without the use of a dirty sleep() function. All you need in your case is to set a timer in the "IF (Msg==blah)" function and when that timer is triggered perform the status changes once more (two times). It would be much more elegant (and doesn't halt everything else).