Windows is not a real-time OS. There is no reasonable expectation for it to perform as one in places where one is required.
In this case, what is required is only a "soft-real-time" OS, which even Linux can manage. But for this sort of project it is more usual to use a microcontroller.
Programming microcontrollers is, incidentally, much more fun than programming a big'n'sloppy desk OS like windows ... or linux.
It only seems that way because of fanboyism. My comment suggesting Linux is currently sitting on -4 points. Windows fanboys feel bad when Windows is questioned. It's not based on logic, it's just a bizarre attachment to the only OS they've ever seriously used.
Windows is not a real-time OS. There is no reasonable expectation for it to perform as one in places where one is required.
In this case, what is required is only a "soft-real-time" OS, which even Linux can manage. But for this sort of project it is more usual to use a microcontroller.
Programming microcontrollers is, incidentally, much more fun than programming a big'n'sloppy desk OS like windows ... or linux.