I desperately need to figure out the best method to get a 13ms timer. It doesn't need to be perfect, but as close as possible.
As a newbie to timers I first tried the standard win32 timer (wasted time)
I then found an article on timers :
Timers Tutorial - CodeProject
so figured I would get the best available according to the article: Queue timers, with the same slow result.
I used GetSystemTime to try and benchmark how long my execution is and it seemed to be less than 1ms:
Code:
hdc = GetDC(hwnd);
hPen = CreatePen(PS_SOLID,1,RED);
SelectObject(hdc, hPen);
if(x == 600)
{
x = 0;
y = 240;
hPen = CreatePen(PS_SOLID,1,GREEN);
SelectObject(hdc, hPen);
}
MoveToEx(hdc, x, y, NULL);
y = baseline - (signalpoints[x]/10);
LineTo(hdc, x, y);
x++;
ReleaseDC(hwnd, hdc);
seems like simple code, signalpoints is an array of ints
Any suggestions ?
I was going to try multimedia timers but MSDN says they are obselete.
All I am trying to do is draw a heartbeat waveform across the screen.