Thread.Sleep is not accurate enough. I was seeing between 2-7 ms of difference, even for long running delays. In https://github.com/robotdotnet/robotdotnet-wpilib/commit/96e965999885a12db3bd11d9c353ddefaf157243 I implemented one I have used before, where it delays up to 50ms before the needed time, and then runs a busy loop. I'll try and look for a way to precisely sleep without a busy loop, but for now it seems to work, and doesn't seem to be causing issues.
Thread.Sleep is not accurate enough. I was seeing between 2-7 ms of difference, even for long running delays. In https://github.com/robotdotnet/robotdotnet-wpilib/commit/96e965999885a12db3bd11d9c353ddefaf157243 I implemented one I have used before, where it delays up to 50ms before the needed time, and then runs a busy loop. I'll try and look for a way to precisely sleep without a busy loop, but for now it seems to work, and doesn't seem to be causing issues.