Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 03 Nov 2000 12:36:24 -0700
From:      Warner Losh <imp@village.org>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: granularity of gettimeofday() 
Message-ID:  <200011031936.MAA19515@harmony.village.org>
In-Reply-To: Your message of "Fri, 03 Nov 2000 10:17:25 PST." <20001103101725.K20567@fw.wintelcom.net> 
References:  <20001103101725.K20567@fw.wintelcom.net>  <920.973271386@critter> <Pine.SOL.4.21.0011031255360.118-100000@jade> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20001103101725.K20567@fw.wintelcom.net> Alfred Perlstein writes:
: Gettimeofday will force a check of the system hardware, basically
: you should get better than 100HZ resolution with gettimeofday.

gettimeofday on many systems do this.  There are other, older systems
that do not have a high resolution clock to read and rely on timer
interrupts to update the clock.  These systems limit their
gettimeofday reports to 10ms + a "uniqifier" that means two calls to
gettimeofday in a row don't get the same value.

On FreeBSD, we go ahead and read the timer hardware so you aren't
limited to 1/HZ increments.

Warner


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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200011031936.MAA19515>