I added your loops to add 5ms delay to 20ms task but I cannot still repro this. Although I cannot be sure the that loop you have in your code will necessarily take 1ms on my hardware. The next step would be to use some tracing tool like Tracelyzer to get the details of what is running when your task is missing events.