GetTickCount timer, I need a 'DoEvents' or something
This just runs a console window and nothing shows up, no errors.. VS.NET
Code:
#include <windows.h>
#include <iostream.h>
void main()
{
bool OK = 0;
long TEMP = 0;
long LASTTIME=0;
long DELAY = 500;
do
{
TEMP = GetTickCount();
if (TEMP >= LASTTIME + DELAY)
{
cout << "Tick TocK\n";
}
LASTTIME = TEMP;
}while(OK == 0);
}
Your code logic is still flawed
That's because TEMP is always greater than (0 + 500), unless your computer takes less than 500 milliseconds to boot.:D