If you intend on using SleepEx, I would suggest setting the second argument of the SleepEx function (BOOL bAlertable) to FALSE to guarantee that the function willl not return until the time-out period has elapsed; however, I would imagine that the traditional Sleep function would work for most general purposes.