Can you change this to:

Sleep((usecs+999)/1000);
return 0;