Use Sleep(1) instead of Sleep(0).