RE: [GD-Windows] Get exact CPU frequency
Brought to you by:
vexxed72
From: Andrew G. <ag...@cl...> - 2002-07-15 19:13:14
|
a) I think the method you are using is only supported on some OSs. A better approach is to use RDTSC before and then after a known time period has elapsed, taking measures for slight variations and errors. Try searching Intels developers site. b) GetTickCount can be rather inaccurate, use QueryPerformanceCounter/Frequency Andrew Grant- Climax Brighton > -----Original Message----- > From: Grisha Spivak [mailto:_g...@tu...] > Sent: 15 July 2002 12:52 > To: Gam...@li... > Subject: [GD-Windows] Get exact CPU frequency > > > How can I get exact CPU frequency? I need it for timer which > uses RDTSC > instruction. Currently I read '~MHz' value from > HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcesso > r\0, but it > not exact - after 2 min running difference between my timer > and GetTickCount > is 15 ms. > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Gamedevlists-windows mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=555 > |