--
On Tue, 6 Jun 2006 17:07:44 +0200 (CEST)
kama <[EMAIL PROTECTED]> bubbled:
>
>
> On Tue, 6 Jun 2006, Martin Zwickel wrote:
>
> > --
> > On Tue, 06 Jun 2006 05:31:19 -0400
> > Gary <[EMAIL PROTECTED]> bubbled:
> >
> > > gettimeofday() replaced times(), at least on freebsd. also,
> > > gettimeofday()'s results will change, depending on if your OS uses
> > > ACPI, TSC, HPET, 8254 etc..
> >
> > gettimeofday replaces times?
Not under Linux:
DESCRIPTION
times() stores the current process times in the struct tms that buf
points to. The struct tms is as defined in <sys/times.h>:
I just wanted to point to a function that does not depend on the
system time. To write an app that needs a good time source,
gettimeofday is the wrong way... or maybe a mix of runtime and system
time to check for resets if there is no other way.
But in my tests gettimeofday was not stable enough for my needs.
> > The two functions are for a different behaviour. The one is for the
> > system time, the other for the process time. Also gettimeofday uses
> > nanoseconds and times uses clock ticks.
>
> So according to the pages, you will have a greater accuracy with
> gettimeofday(). instead of 128th of a second you get a 1000000th of a
> second.
>
> Never the less.. I wrote a simple C program that meassured the diff
> off gettimeofday() and the diff where quite high in FreeBSD 6.1.
I had the same results under Linux, that's why I used times, after that
RDTSC, then on the arm platform my server should run on: a seperate
PCR/STC counter.
> It went from 0.000003s (3us) to 0.041022s (41ms) between the calls.
> And 40ms of a gettimeofday call should cause problem on a high
> tickrate server. Not all the 100 times showed 40+ms, the standard was
> more 10-12ms, which is extremely high.
Yeah, the default 10ms schedule time.
> ...
> Maybe finally I have found something that can explain why I get
> strange chokes on my servers every now and then?
Maybe?! Valve should do some test about the gettimeofday usage!
--
MyExcuse:
it's an ID-10-T error
Martin Zwickel <[EMAIL PROTECTED]>
Research & Development
TechnoTrend AG <http://www.technotrend.de>
--
[ signature.asc of type application/pgp-signature deleted ]
--
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux