RE: [GD-Windows] Performance timing
Brought to you by:
vexxed72
From: tweety <mi...@sy...> - 2004-02-11 19:30:26
|
Disagree again :) I wrote the following program: ----------------------------------- #include "stdafx.h" #include <windows.h> int _tmain(int argc, _TCHAR* argv[]) { DWORD currenttick=3DGetTickCount(), oldtick=3Dcurrenttick, starttick=3Dcurrenttick; while(currenttick - starttick<=3D10000) { currenttick=3DGetTickCount(); if(oldtick!=3Dcurrenttick) { printf("%10d\n", currenttick); oldtick=3Dcurrenttick; } } return 0; } ----------------------------------- And part of its output is: ----------------------------------- 70250890 70250906 70250921 70250937 70250953 70250968 70250984 70251000 70251015 70251031 70251046 70251062 70251078 70251093 70251109 70251125 ----------------------------------- As you can see, the delta is between 15-16ms. More than enough to count = time between 60hz frames... ---------------------------------- Peace and love, Tweety mi...@sy... - twe...@us... YahooID: tweety_04_01 -----Original Message----- From: gam...@li... [mailto:gam...@li...] On Behalf Of = chaac Sent: February 11, 2004 5:40 AM To: gam...@li... Subject: Re: [GD-Windows] Performance timing tweety wrote: > Same here; this was what I was talking about. > Besides, rdtsc and queryperformancetimer has some very nasty=20 > sincronization problems with multiple processors (they give the time=20 > slightly different wether the code is run on different processors). > Good old GetTickCount does its job :) Hi, But then again, if I remember correcly, GetTickCount goes in steps of = 32ms. If you need more accuracy, you are out of the game here. And if you are just profiling on your development machine or at machine = you can reach or otherwise know some details about it. You can quite easily = use other measurement methods also. In some cases how fast to get time is not the issue, but accuracy of = delta time is. Thanks, Vesa J=E4=E4skel=E4inen ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on = Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Gamedevlists-windows mailing list Gam...@li... https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=3D555 |