[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gettimeofday() and clock



On Mon, Sep 02, 2002 at 11:40:01AM -0500, Steve Baker wrote:

> Well, it *says* some vague stuff about being able to use usleep for
> delays longer than ~10ms - but my experiment (at least on my computer)
> shows that ~20ms is the minimum delay.  I do a *LOT* of heavy realtime
> work - and I'm 100% certain that you can't reliably delay for less than
> 20ms.  So either the kernel is indeed running at 50Hz - or it has some
> kind of a bug that prevents it from rescheduling the task when it should.

Doing a little test here (linux 2.4.19 on i686) the time slice is indeed
10ms and the minimum delay is 20ms.  You always get between 10 and 20ms
more than you asked for.  It seems to be waiting an extra time slice
beyond what you asked for.

-- 
Christopher John Purnell  | I thought I'd found a reason to live
http://www.lost.org.uk/   | Just like before when I was a child
--------------------------| Only to find that dreams made of sand
What gods do you pray to? | Would just fall apart and slip through my hands