The glove itself produces trains of data at ~500hz: casts ten bytes and then waits 2ms. Too bad, I couldn't leave the scheduler the privilege to subtract more time.
What follows is a short C function to change priority of the running process:
void prioritizza(DWORD value) {
// PID of this process
int processID = GetCurrentProcessId();
// handler of this process
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, processID);
// actually sets priority
SetPriorityClass(hProcess, value);
};
Remember to include "windows.h"
In the end, as values, I used the constant HIGH_PRIORITY_CLASS. Here follow the constants you could use in your own programs:
IDLE_PRIORITY_CLASS BELOW_NORMAL_PRIORITY_CLASS NORMAL_PRIORITY_CLASS ABOVE_NORMAL_PRIORITY_CLASS HIGH_PRIORITY_CLASS REALTIME_PRIORITY_CLASS
No comments:
Post a Comment