I’m having weird desynchronizations on the client. I checked everything and finally stumbled upon the timing routine. At first I thought it had an error which would be bad since Soldat uses the same one. But it occured I just didn’t use a precise computer time measure. I should use QueryPerformanceCounter. Is there a linux alternative?
Written by MM. Posted at 7:17 am on August 10th, 2010
2 comments.
Post a comment.
gettimeofday(), generally, but accuracy doesn’t go past milliseconds on all systems, sadly.
also if you’re intending to use QueryPerformanceCounter be sure to read this: http://support.microsoft.com/kb/274323
this might be helpful, too, for reference’s sake: http://www.stlsoft.org/doc-1.9/classplatformstl_1_1performance__counter.html
According to: http://lwn.net/Articles/167897/
Linux kernels 2.6.16 and higher support nanosecond resolution time using hrtimer
According to: http://www.songho.ca/misc/timer/timer.html
gettimeofday() _should_ give microsecond resolution time and the only report I have seen it return less than microsecond was on an embedded processor