5
![Stack Overflow](http://cdn.sstatic.net/stackoverflow/img/apple-touch-icon.png)
There are several problems with the code you've posted. First off, you should never use a while loop to halt code execution.
Secondly, you're setting a timeout, which allows other code to be executed in the interim (yes, even if the timeout is zero seconds). Remove that and you should be able...