Re: function for clockticks since 1980?



Peter J. Holzer wrote:

Linux and other POSIX-compatible systems have the gettimeofday function,
which returns the time in seconds and microseconds since the epoch. Be
warned that the actual resolution of the clock can be much coarser:
Linux/x86 actually uses a microsecond clock, but some other Unixes have
resolutions of something between 1/60 to 1/1024 of a second.

Linux/x86 (and possibly other platforms as well) are able to offer
sub-jiffie resolution by interpolating cycle counter values.

On Linux/x86 the /resolution/ is less than 1 ns when using the TSC
on a CPU faster than 1 GHz.

(Contrast resolution with precision and accuracy.)
.



Relevant Pages

  • Re: function for clockticks since 1980?
    ... which returns the time in seconds and microseconds since the epoch. ... Linux/x86 actually uses a microsecond clock, ... sub-jiffie resolution by interpolating cycle counter values. ...
    (comp.lang.c)
  • Re: [patch 00/21] hrtimer - High-resolution timer subsystem
    ... Right now the primary function of the state is to tell whether the timer ... > Of course if you consider the possibility of including high resolution ... problem requires solving problems in the clock abstraction first, ...
    (Linux-Kernel)
  • Re: [PATCH] ktimers subsystem 2.6.14-rc2-kt5
    ... > a clock with a better resolution. ... > resolution than the physical clock has. ... reaches this count the timer is expired. ... OTOH We could also do this at the timer interrupt: ...
    (Linux-Kernel)
  • Re: Need to implement a calendar clock with millisecond resolution, please help.
    ... true, as I am a newbie, not even a real programmer), but I need to ... implement a calendar time clock with a millisecond resolution. ... system include clock, delay(), gettimeofday, msleep, ...
    (comp.lang.c)
  • Re: Q about noise in time interval measurement averging
    ... I have a PIC measuring a time interval to 25ns resolution, ... I cant seem to recall how the noise reduces with increasing samples, ... your need to know the sense of the rotation as well as it's speed. ... My own inclination would be to go for a faster clock - using ...
    (sci.electronics.design)