teotigraphix / Framework4Bitwig

Bitwig controller API framework extensions.
GNU Lesser General Public License v3.0
58 stars 13 forks source link

host.scheduleTask very slow on Windows 10 #261

Closed git-moss closed 4 years ago

git-moss commented 4 years ago

Since one of the 3.2.x versions the schaduleTask method is very slow on Windows 10. I could not reproduce that on the other OSs. E.g. a 400 ms timeout takes about 3 seconds to fire.

alexr1221 commented 4 years ago

Hello,

I also have this problem, it adds ~20% of time in my case. I checked with Date.now() before and after.

git-moss commented 4 years ago

In my case it was a side effect of the slow USB sending (the Push 2 display process). So not actually a bug. You should check if you have processing happening the flush method which takes up some time. 20% is not that surprising.

alexr1221 commented 4 years ago

Thanks for the reply. I had saw your other post on Bitwig's forum, I checked what could slow down the process but the only thing I use is noteInput.sendRawMidiEvent(). The thing that is curious is it's not just 20% added to the initial delay but 20% multiplied to the initial delay. Just like if the system's clock was not well setup, with 1sec = 1.2sec. I got around this problem by multiplying the delay by a determined number.