[TriLUG] Timer resolution question

Sam Kalat sam.kalat at gmail.com
Mon May 16 11:50:34 EDT 2005


>From what I understand, it isn't that gettimeofday and other functions
are wrong, so much as you get funny results because of scheduling. 
Things look like they have changed since I last looked at it with a
2.4 kernel, but beware that using timers for very small intervals can
be a tricky task (on any OS I've used).  If you're lucky you might be
able to look at your goal a different way and avoid the details,
otherwise you'll have to tinker with scheduling or bleeding-edge timer
projects to get what you want.  Also note that the time spent in a
timer check can be substantial (and in my own experience can increase
with the frequency of the call) so there are other good reasons to
limit your expectations.

http://www.tldp.org/HOWTO/IO-Port-Programming-4.html

Sam Kalat



On 5/11/05, Charles Fischer <fischer at 4pi.com> wrote:
> Is there a way to measure time on a Linux box in one millisecond
> granularity?  On Intel boxes I have tried the granularity seems to be 10 or
> 15 milliseconds for the gettimeofday and ftime functions.  Microsoft
> Windows has the same granularity on these boxes, but Microsoft has
> multimedia timers and high resolution timers, which have higher
> resolution.  So in short is there a Linux version of Microsoft's high
> resolution timer?
> 
> Thanks
> Charles Fischer
> 
> --
> TriLUG mailing list        : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ  : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
> TriLUG PGP Keyring         : http://trilug.org/~chrish/trilug.asc
>



More information about the TriLUG mailing list