Having only one function run at higher priority
I would like my timer function, which uses the Windows multimedia timer, to run at a higher-than-normal priority. I want the main program itself to run at normal priority but the timer function (and only this function) to run at high priority. How can this be done, if it's possible?
As a side note (clues) I've noticed that, as background tasks run, the timer slows down and the more CPU usage the background tasks have (all at normal priority), the slower the timer gets to nearly stopped when 95% CPU usage is present (at 95% usage, it takes 20 seconds for 1 second to show in the timer). Run my program from the IDE and it's smooth motion. If I switch to Windows Task Manager (which averages 7% CPU usage) then to my program while still running, a "jerk" occurs roughly 3 times a second due to the timer being slower than it should be.