Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Dec 1999 10:03:34 +1100
From:      Peter Jeremy <peter.jeremy@alcatel.com.au>
To:        Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc:        arch@freebsd.org
Subject:   Re: Threads stuff
Message-ID:  <99Dec3.095608est.40342@border.alcanet.com.au>
In-Reply-To: <819.944166174@critter.freebsd.dk>
References:  <99Dec3.070619est.40333@border.alcanet.com.au> <819.944166174@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On 1999-Dec-03 07:22:54 +1100, Poul-Henning Kamp wrote:
>In message <99Dec3.070619est.40333@border.alcanet.com.au>, Peter Jeremy writes:
>>On my PII-266, clock_gettime(CLOCK_REALTIME) takes 2.48usec and
>>gettimeofday() takes 2.42usec - slightly better.

>The time it takes depends on the "timecounter" you are using for
>your timekeeping.  I will venture to guess that the above numbers
>come from a UP machine using the TSC.

Ooops, I forgot about that.  Yes, this is an UP system using the TSC.
AFAIK, I can't swap to the 8254 w/o rebooting.

I tried the same thing on a P-133 using the i8254 and got:
clock_gettime(CLOCK_REALTIME)  6.92 usec
gettimeofday()                 5.93 usec

(And on a 386SX25 running 2.2.5, I got 115usec).

>If the timestamps don't need to be more precise than 1/hz,

I suspect that for the purposes in question, it _does_ need to
be SMP safe (which writes off the TSC) and will need better than
1/hz precision (though I'm not definite about this).

Peter




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?99Dec3.095608est.40342>