Subject: Re: usleep() and system clock resolution
To: None <ruibiao@arl.wustl.edu>
From: James Tuman Nelson <jimtnelson@earthlink.net>
List: netbsd-help
Date: 05/18/2000 22:20:22
While we are on the subject of system clock, would anyone know why my
system clock would fail to keep accurate time within hours?  The time
seems to slip by several minutes or hours over the course of a day, but
not while I am checking over the course of several minutes.  It seems to
go to sleep for some time, or suspend time keeping.  Has anyone had this problem?

Running 1.4.2 on a Pentium I at 133 MHertz.

Jim Nelson

Ruibiao Qiu wrote:
> 
> On Thu, 18 May 2000, Jason R Thorpe wrote:
> 
> >On Thu, May 18, 2000 at 02:13:22PM -0500, Ruibiao Qiu wrote:
> >
> > > So, I wonder if usleep() can get to less than 10 ms.  Does it has
> > > anything to do with system clock resolution?  How can I find out
> > > the current value of it?  How can I configure it?
> >
> >Yes, in fact, it has everything to do with the system clock resolution.
> >The system clock ticks every 10ms, so that is the minimum scheduling
> >granularity.
> >
> >Try building your kernel with:
> >
> >options HZ=256
> >
> >That would make the granularity slightly less than 5ms, and might work
> >on a PC.
> 
> I cant find this option in `man options`.  I am running a 1.4.1
> GENERIC kernel.  What does this option mean?  Thanks.
> 
>           Regards
> 
>             Ruibiao