thread block at 5sec intervals leading to lag

i’ve run into a problem where i get a massive increase in wait time, all due to thread block, at 5 second intervals lasting for maybe half a second, which is leading to significant lag in my environment.

im using a national instruments driver and data acquisition board to acquire input from a mouse

this problem has seemingly popped out of nowhere, as i’ve only installed windows update - nothing else with my pandascript or my mouse driver has changed.

any hints as to how to figure out what’s causing the thread block??