Keep in mind that the Win32 Sleep API behaves differently from Perl when the argument passed is zero. Presumably, when the Perl sleep() function is passed zero, your script sleeps for zero seconds, i.e. returns immediately. (I say "presumably" because I haven't actually tested this.)
However, an argument of zero causes the Win32 Sleep API to give up the rest of its time slice. Depending on what other threads are running, it could be more than zero milliseconds before your script is running again.