This is my timing system that uses the Win32 API's GetTickCount for timing. At times, it seems like it isn't counting the seconds correctly. Here is my simple timing system.
cge is my instance of a class I wrote, and the AddSecond member function increments a variable that holds how many seconds has passed. Then I have it display the value of that variable, that holds the elapsed seconds, when you click on the window. This number doesn't look right sometimes, it looks like it isn't catching all the seconds and I was wondering if I am doing something wrong? Thanks.Code:int iTickCount; static int iPrevTick=0; while(GetMessage(&msg,NULL,0,0)) { TranslateMessage(&msg); DispatchMessage(&msg); iTickCount=GetTickCount(); if(iTickCount>=iPrevTick) { iPrevTick=iTickCount+1000; cge->AddSecond(); } }



LinkBack URL
About LinkBacks


