Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Apr 2002 16:29:22 -0700
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Poul-Henning Kamp <phk@freebsd.org>
Cc:        arch@freebsd.org
Subject:   Re: get{bin,micro,nano}[up]time() - what precision ?
Message-ID:  <3CBB6252.6BAA4E90@mindspring.com>
References:  <54342.1018890897@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote:
> I'm soliciting input from users of the get*time() family of functions
> in the kernel on what the minimal desirable precision is.
> 
> Currently they return a timestamp which is no more than 1/HZ out
> of date.  For contemporary values of HZ, that seems to be adequate.
> 
> As people increase HZ to above 10000, it starts to cost more to
> update timecounters every tick, and the question naturally arises:
> what is the target resolution for get*time() functions ?
> 
> Would anybody get in trouble if the precision never got better
> than 10msec, even for higher HZ ?
> 
> If so, would 1msec be an acceptable limit ?

SPARC had a 4uS resolution in ~1990; it did this by having a
hardware clock of very high resolution, and a low update
frequency, from which a delta was maintained in software,
rather than by having an update requirement for a full
timecounter like structure.

I used this for a 100uS select(2) timeout for pacing in a game,
at one point in time.

It's probably worth considering Sun's SunOS 4.1.3 approach for
FreeBSD.

-- Terry

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?3CBB6252.6BAA4E90>