Code: Select all
REPEAT
OFF
K% = INKEY(4)
UNTIL K% <> -1
It turns out that the culprit is that innocent-looking OFF. Because it's (quite unnecessarily) inside the loop it gets executed around 25 times a second, and OFF is equivalent to VDU 23,1,0,0,0,0,0,0,0,0! So what it was actually doing was keeping the GUI thread awake pretty much continuously processing those VDU commands.
Moving the OFF outside the loop reduced the CPU usage to close to zero.