Mailing List Archive


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

Re: [tlug] timing for geeks II.



Michal Hajek <hajek1@example.com> wrote:

> The gettimeofday() can get as bad as 0.03s time diference between
> succesive readings (TDBSR). 
> clock_gettime(CLOCK_MONOTONIC..) can get as bad as 0.077034s TDBSR.
> clock_gettime(CLOCK_REALTIME..) can get as bad as 0.0416s TDBSR.

This is no surprise and is actually expected in a general purpose 
multitasking operating system such as Linux. You are probably not 
measuring deficiencies in the clock, but the amount of that the 
operating system does not run your program. This is a very well 
know issue on general purpose operating systems, including Linux. 

> There is a related question - can one buy a better clock for a linux
> mashine? I imagine a gigaherz source in a PCI slot .... :)  

The clock is probably not the problem, 
and a "better" clock would probably not work any better for you. 

If you really need small "TDBSR", then you need a real-time 
operating system. Linux is a general purpose operating system, 
but is not a real-time operating system, although there is much 
work on improving Linux's real-time performance, even if it isn't 
an actual real-time operating system. There are also genuine 
(hard) real-time operating systems that can run Linux. 

What problem are you actually trying to solve (or understand)? 



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links