[ENet-discuss] timer resolution

Brad Monahan xbradx_00 at hotmail.com
Sat Feb 28 13:31:24 PST 2004


I noticed enet uses GetTickCount() for timing in the win32 side of things. 
I'm in the process of changing this so it uses QueryPerformanceCounter 
instead, falling back on timeGetTime and timeBeginPeriod/timeEndPeriod (for 
up to 1ms resolution) if the performance timer is not available. I'm using 
the roundTripTime calculated by enet for the interpolation/extrapolation on 
my client and it seems to not be accurate enough for this purpose. Should I 
even be doing this? I thought that was a feature of enet. It keeps track of 
the average ping so you can do stuff like that. I know GetTickCount() has 
_atleast_ a 10ms resolution if not closer to 20ms (if I remember correctly) 
and the performance timer has well under 1ms resolution. This is just a 
suggestion post for the next version of enet. It would be very easy to 
implement and there would be a much greater performance aspect. I don't know 
how good the unix timer is or it's resolution, so I can't offer anything on 
the unix side of things, but this would make a great addition on the win32 
side.

-Brad

_________________________________________________________________
Dream of owning a home? Find out how in the First-time Home Buying Guide. 
http://special.msn.com/home/firsthome.armx



More information about the ENet-discuss mailing list