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

Re: precision timer?



Kevin Wooley <kwooley@xxxxxxx.com> writes:

> BTW, I'm looking for 1-10uS precision at best, 1mS precision at the worst.
> Pretty big range, but I'll take what I can get with minimal effort.

> > My suspicion is that I should somehow use either the Real Time Clock on the
> > devboard or one of the built in hardware timers.  I'd rather do this in user
> > space than driver/kernel space.  I don't need to trigger other events, just
> > measure the time between two function calls.

Just use the normal gettimeofday system call, it has usec precision
and is probably fairly accurate too.  If the accuracy isn't good
enough for your needs, it's always possible to improve the kernel code
that supplies the time to the gettimeofday call.

  /Christer

-- 
"Just how much can I get away with and still go to heaven?"

Freelance consultant specializing in device driver programming for Linux 
Christer Weinigel <christer@xxxxxxx.se">http://www.weinigel.se