I'm not sure how much this will help. A sleep for 5ms doesn't give much time for other stuff on the machine in particular if it is heavily loaded. Also I think on some systems (maybe just Windows?) the resolution of sleep was around 10ms or so anyway and you can't really sleep for less than that.