Archived

This topic is now archived and is closed to further replies.

merwin

GetTickCount()

Recommended Posts

merwin    122
I''ve made a program which makes use of the ''GetTickCount()'' function. This function must return the time in ms. I use a var ''dwOldTime'' which is a DWORD that gets the return of GetTickCount everytime that dwOldTime + 100 < GetTickCount(). I''m now debugging my program and everytime check the value of dwTime (dwTime = GetTickCount() - dwOldTime) it''s more than 2000, sometimes it has a value around 18000... :S. Has someone tips or suggestion how I can solve this problem, is probably some part of my program very ineffeciently written, or is the value of dwTime during compiling not properly? Any help would be welcome.

Share this post


Link to post
Share on other sites
Do you have it written to send WM_TIMER messages every time the tick count reaches a certain point? I forget exactly how it works, I just know the timer never stops and if you randomly check it at certain points, you''ll need pinpoint accuracy or something to slow the program down to a certain speed.

Try looking for some timer tutorials or posting the source code that deals with your timer stuff...

www.winprog.org might have something.

Share this post


Link to post
Share on other sites
Anon Mike    1098
Don''t start going down the road of blaming the compiler. It is *extremely* more likely that you have a bug in your code or you don''t understand something properly.

WM_TIMER has nothing to do with GetTickCount.

You don''t really give enough info to diagnose this problem. It would help if you posted a (short!) bit of code that demonstrated it.

Share this post


Link to post
Share on other sites